mirror of https://github.com/explosion/spaCy.git
Remove near-duplicate test
This commit is contained in:
parent
960d9cfadc
commit
8b5594df86
|
@ -332,55 +332,3 @@ def test_dependency_matcher_ops(en_vocab, doc, left, right, op, num_matches):
|
||||||
matcher.add("pattern", [pattern])
|
matcher.add("pattern", [pattern])
|
||||||
matches = matcher(doc)
|
matches = matcher(doc)
|
||||||
assert len(matches) == num_matches
|
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])
|
|
||||||
|
|
Loading…
Reference in New Issue