From 423849f94a09cb5979e5bb7953c576d6e50b1b3c Mon Sep 17 00:00:00 2001 From: Adriane Boyd Date: Fri, 13 Mar 2020 09:25:23 +0100 Subject: [PATCH] Fix sents comparison in test util Due to changes to `Span` (#5005), spans from different documents are now never equal. Check `Token.is_sent_start` values instead. --- spacy/tests/util.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spacy/tests/util.py b/spacy/tests/util.py index 52768dd41..a0d6273a9 100644 --- a/spacy/tests/util.py +++ b/spacy/tests/util.py @@ -116,8 +116,7 @@ def assert_docs_equal(doc1, doc2): assert [t.head.i for t in doc1] == [t.head.i for t in doc2] assert [t.dep for t in doc1] == [t.dep for t in doc2] - if doc1.is_parsed and doc2.is_parsed: - assert [s for s in doc1.sents] == [s for s in doc2.sents] + assert [t.is_sent_start for t in doc1] == [t.is_sent_start for t in doc2] assert [t.ent_type for t in doc1] == [t.ent_type for t in doc2] assert [t.ent_iob for t in doc1] == [t.ent_iob for t in doc2]