From d21459f87dfcda5a181997575cb9a003c6ebd361 Mon Sep 17 00:00:00 2001 From: ines Date: Fri, 2 Jun 2017 21:42:26 +0200 Subject: [PATCH] Update serializer tests --- spacy/tests/serialize/test_serialize_parser_ner.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spacy/tests/serialize/test_serialize_parser_ner.py b/spacy/tests/serialize/test_serialize_parser_ner.py index 6d5d8ba1e..ae9e23e9a 100644 --- a/spacy/tests/serialize/test_serialize_parser_ner.py +++ b/spacy/tests/serialize/test_serialize_parser_ner.py @@ -14,12 +14,11 @@ test_parsers = [DependencyParser, EntityRecognizer] @pytest.mark.parametrize('Parser', test_parsers) def test_serialize_parser_roundtrip_bytes(en_vocab, Parser): parser = Parser(en_vocab) - parser.model, _ = parser.Model(0) - parser_b = parser.to_bytes() + parser.model, _ = parser.Model(10) new_parser = Parser(en_vocab) - new_parser.model, _ = new_parser.Model(0) - new_parser = new_parser.from_bytes(parser_b) - assert new_parser.to_bytes() == parser_b + new_parser.model, _ = new_parser.Model(10) + new_parser = new_parser.from_bytes(parser.to_bytes()) + assert new_parser.to_bytes() == parser.to_bytes() @pytest.mark.parametrize('Parser', test_parsers) @@ -32,4 +31,4 @@ def test_serialize_parser_roundtrip_disk(en_vocab, Parser): parser_d = Parser(en_vocab) parser_d.model, _ = parser_d.Model(0) parser_d = parser_d.from_disk(file_path) - assert parser.to_bytes() == parser_d.to_bytes() + assert parser.to_bytes(model=False) == parser_d.to_bytes(model=False)