a57bdeecacb664e80e0c8408492e28eb9dd31a79,spacy/tests/test_misc.py,,test_load_model_version_compat,#,152

Before Change


        // additional compatible upper pin
        nlp.meta["spacy_version"] = ">=2.3.0,<2.4.0"
        nlp.to_disk(d)
        nlp2 = util.load_model(d)

        // incompatible older version
        nlp.meta["spacy_version"] = ">=2.2.5"
        nlp.to_disk(d)
        with pytest.warns(UserWarning):
            nlp_reloaded = util.load_model(d)

        // invalid version specification

After Change


        // no change: compatible
        nlp.to_disk(d)
        meta_path = Path(d / "meta.json")
        util.get_model_meta(d)

        // additional compatible upper pin
        nlp.meta["spacy_version"] = ">=2.3.0,<2.4.0"
        srsly.write_json(Path(d / "meta.json"), nlp.meta)
        util.get_model_meta(d)

        // incompatible older version
        nlp.meta["spacy_version"] = ">=2.2.5"
        srsly.write_json(Path(d / "meta.json"), nlp.meta)
        with pytest.warns(UserWarning):
            util.get_model_meta(d)

        // invalid version specification
        nlp.meta["spacy_version"] = ">@//$%_invalid_version"
        srsly.write_json(Path(d / "meta.json"), nlp.meta)
        with pytest.warns(UserWarning):
            util.get_model_meta(d)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: explosion/spaCy
Commit Name: a57bdeecacb664e80e0c8408492e28eb9dd31a79
Time: 2020-06-03
Author: adrianeboyd@gmail.com
File Name: spacy/tests/test_misc.py
Class Name:
Method Name: test_load_model_version_compat


Project Name: explosion/spaCy
Commit Name: a57bdeecacb664e80e0c8408492e28eb9dd31a79
Time: 2020-06-03
Author: adrianeboyd@gmail.com
File Name: spacy/tests/test_misc.py
Class Name:
Method Name: test_load_model_version_compat