diff --git a/spacy/tests/matcher/test_dependency_matcher.py b/spacy/tests/matcher/test_dependency_matcher.py index 69e85140d..72005cc82 100644 --- a/spacy/tests/matcher/test_dependency_matcher.py +++ b/spacy/tests/matcher/test_dependency_matcher.py @@ -332,55 +332,3 @@ def test_dependency_matcher_ops(en_vocab, doc, left, right, op, num_matches): matcher.add("pattern", [pattern]) matches = matcher(doc) assert len(matches) == num_matches - - -@pytest.mark.parametrize( - "pattern", - [ - # empty - [], - # unsupported op - [ - {"RIGHT_ID": "jumped", "RIGHT_ATTRS": {"ORTH": "jumped"}}, - { - "LEFT_ID": "jumped", - "REL_OP": "==", - "RIGHT_ID": "fox", - "RIGHT_ATTRS": {"ORTH": "fox"}, - }, - ], - # first dict isn't just a node - [ - { - "LEFT_ID": "jumped", - "REL_OP": "==", - "RIGHT_ID": "fox", - "RIGHT_ATTRS": {"ORTH": "fox"}, - }, - ], - # missing op - [ - {"RIGHT_ID": "jumped", "RIGHT_ATTRS": {"ORTH": "jumped"}}, - {"LEFT_ID": "jumped", "RIGHT_ID": "fox", "RIGHT_ATTRS": {"ORTH": "fox"},}, - ], - # missing left-hand ID - [ - {"RIGHT_ID": "jumped", "RIGHT_ATTRS": {"ORTH": "jumped"}}, - {"REL_OP": ">", "RIGHT_ID": "fox", "RIGHT_ATTRS": {"ORTH": "fox"},}, - ], - # missing right-hand ID - [ - {"RIGHT_ID": "jumped", "RIGHT_ATTRS": {"ORTH": "jumped"}}, - {"LEFT_ID": "jumped", "REL_OP": ">", "RIGHT_ATTRS": {"ORTH": "fox"},}, - ], - # missing right-hand attrs - [ - {"RIGHT_ID": "jumped", "RIGHT_ATTRS": {"ORTH": "jumped"}}, - {"LEFT_ID": "jumped", "REL_OP": ">", "RIGHT_ID": "fox",}, - ], - ], -) -def test_dependency_matcher_pattern_validation(en_vocab, pattern): - matcher = DependencyMatcher(en_vocab) - with pytest.raises(ValueError): - matcher.add("pattern", [pattern])