From 72b9bd57ec8b7cf6fb4045da32e99704b27d0ba1 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Thu, 3 Nov 2016 00:09:35 +0100 Subject: [PATCH] Test Issue #588: Matcher accepts invalid, empty patterns. --- spacy/tests/regression/test_issue588.py | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 spacy/tests/regression/test_issue588.py diff --git a/spacy/tests/regression/test_issue588.py b/spacy/tests/regression/test_issue588.py new file mode 100644 index 000000000..0b7defe75 --- /dev/null +++ b/spacy/tests/regression/test_issue588.py @@ -0,0 +1,10 @@ +import pytest +from ...vocab import Vocab +from ...tokens import Doc +from ...matcher import Matcher + + +def test_issue588(): + matcher = Matcher(Vocab()) + with pytest.raises(ValueError): + matcher.add(entity_key='1', label='TEST', attrs={}, specs=[[]])