From 399a5803d058d5ccecfd68aad1b012bb1347bb7c Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sun, 24 Feb 2019 19:02:16 +0100 Subject: [PATCH] Tidy up tests [ci skip] --- spacy/tests/doc/test_retokenize_merge.py | 6 +++--- spacy/tests/doc/test_retokenize_split.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/spacy/tests/doc/test_retokenize_merge.py b/spacy/tests/doc/test_retokenize_merge.py index 59547d1b3..4d28d182f 100644 --- a/spacy/tests/doc/test_retokenize_merge.py +++ b/spacy/tests/doc/test_retokenize_merge.py @@ -270,16 +270,16 @@ def test_doc_retokenize_merge_extension_attrs(en_vocab): attrs = {"lemma": "hello world", "_": {"a": True, "b": "1"}} retokenizer.merge(doc[0:2], attrs=attrs) assert doc[0].lemma_ == "hello world" - assert doc[0]._.a == True + assert doc[0]._.a is True assert doc[0]._.b == "1" # Test bulk merging doc = Doc(en_vocab, words=["hello", "world", "!", "!"]) with doc.retokenize() as retokenizer: retokenizer.merge(doc[0:2], attrs={"_": {"a": True, "b": "1"}}) retokenizer.merge(doc[2:4], attrs={"_": {"a": None, "b": "2"}}) - assert doc[0]._.a == True + assert doc[0]._.a is True assert doc[0]._.b == "1" - assert doc[1]._.a == None + assert doc[1]._.a is None assert doc[1]._.b == "2" diff --git a/spacy/tests/doc/test_retokenize_split.py b/spacy/tests/doc/test_retokenize_split.py index 2fc102cf6..5719e4b31 100644 --- a/spacy/tests/doc/test_retokenize_split.py +++ b/spacy/tests/doc/test_retokenize_split.py @@ -137,10 +137,10 @@ def test_doc_retokenize_split_extension_attrs(en_vocab): attrs = {"lemma": ["los", "angeles"], "_": underscore} retokenizer.split(doc[0], ["Los", "Angeles"], heads, attrs=attrs) assert doc[0].lemma_ == "los" - assert doc[0]._.a == True + assert doc[0]._.a is True assert doc[0]._.b == "1" assert doc[1].lemma_ == "angeles" - assert doc[1]._.a == False + assert doc[1]._.a is False assert doc[1]._.b == "2"