mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-11 17:56:30 +03:00
Remove v2 test
This commit is contained in:
parent
63c22969f4
commit
5424b70e51
|
@ -107,36 +107,6 @@ def test_load_model_blank_shortcut():
|
|||
util.load_model("blank:fjsfijsdof")
|
||||
|
||||
|
||||
def test_load_model_version_compat():
|
||||
"""Test warnings for various spacy_version specifications in meta. Since
|
||||
this is more of a hack for v2, manually specify the current major.minor
|
||||
version to simplify test creation."""
|
||||
nlp = util.load_model("blank:en")
|
||||
assert nlp.meta["spacy_version"].startswith(">=2.3")
|
||||
with make_tempdir() as d:
|
||||
# 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(meta_path, nlp.meta)
|
||||
util.get_model_meta(d)
|
||||
|
||||
# incompatible older version
|
||||
nlp.meta["spacy_version"] = ">=2.2.5"
|
||||
srsly.write_json(meta_path, nlp.meta)
|
||||
with pytest.warns(UserWarning):
|
||||
util.get_model_meta(d)
|
||||
|
||||
# invalid version specification
|
||||
nlp.meta["spacy_version"] = ">@#$%_invalid_version"
|
||||
srsly.write_json(meta_path, nlp.meta)
|
||||
with pytest.warns(UserWarning):
|
||||
util.get_model_meta(d)
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"version,constraint,compatible",
|
||||
[
|
||||
|
|
Loading…
Reference in New Issue
Block a user