diff --git a/spacy/tests/doc/data/doc_sentiment_v3.4.2 b/spacy/tests/doc/data/doc_sentiment_v3.4.2 deleted file mode 100644 index 51dd6ef15..000000000 Binary files a/spacy/tests/doc/data/doc_sentiment_v3.4.2 and /dev/null differ diff --git a/spacy/tests/doc/test_doc_api.py b/spacy/tests/doc/test_doc_api.py index f7e6e391d..f866b1667 100644 --- a/spacy/tests/doc/test_doc_api.py +++ b/spacy/tests/doc/test_doc_api.py @@ -991,9 +991,10 @@ def test_doc_spans_setdefault(en_tokenizer): doc.spans.setdefault("key3", default=SpanGroup(doc, spans=[doc[0:1], doc[1:2]])) assert len(doc.spans["key3"]) == 2 -def test_doc_from_disk_v3(): - """Test if docs created in v3.x work with '.from_disk' without throwing errors. This doc includes the sentiment attribute which is removed in v4""" - doc = Doc(Vocab()).from_disk("./data/doc_sentiment_v3.4.2") - assert doc.text == "This is a happy sentence." +def test_doc_sentiment_from_bytes_v3_to_v4(): + """Test if a doc with sentiment attribute created in v3.x works with '.from_bytes' in v4.x without throwing errors. The sentiment attribute was removed in v4""" + doc_bytes = b'\x89\xa4text\xa5happy\xaaarray_head\x9fGQACKOLMN\xcd\x01\xc4\xcd\x01\xc6I\xcd\x01\xc5JP\xaaarray_body\x85\xc4\x02nd\xc3\xc4\x04type\xa3