From 899f1cf44212956ee6bfbb8377aa85ebd251edf2 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 20 Jul 2018 17:15:44 +0200 Subject: [PATCH] Add regression test for issue 2179 --- spacy/tests/regression/test_issue2179.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 spacy/tests/regression/test_issue2179.py diff --git a/spacy/tests/regression/test_issue2179.py b/spacy/tests/regression/test_issue2179.py new file mode 100644 index 000000000..d4f194c0e --- /dev/null +++ b/spacy/tests/regression/test_issue2179.py @@ -0,0 +1,16 @@ +'''Test that spurious 'extra_labels' aren't created when initializing NER.''' +import pytest +from ... import blank + +@pytest.mark.xfail +def test_issue2179(): + nlp = blank('it') + ner = nlp.create_pipe('ner') + ner.add_label('CITIZENSHIP') + nlp.add_pipe(ner) + nlp.begin_training() + nlp2 = blank('it') + nlp2.add_pipe(nlp2.create_pipe('ner')) + nlp2.from_bytes(nlp.to_bytes()) + assert 'extra_labels' not in nlp2.get_pipe('ner').cfg + assert nlp2.get_pipe('ner').labels == ['CITIZENSHIP']