From 8b5594df869db5e573a90a8150380a13b4ae543f Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Wed, 2 Sep 2020 20:32:01 +0200 Subject: [PATCH] Remove near-duplicate test --- .../tests/matcher/test_dependency_matcher.py | 52 ------------------- 1 file changed, 52 deletions(-) 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])