From 6d0cdb163067effe57838125e2c12c1527291767 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Fri, 24 Jul 2015 04:51:53 +0200 Subject: [PATCH] * Py 2/3 compatibility of serialize tests --- tests/serialize/test_packer.py | 2 +- tests/spans/test_times.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/serialize/test_packer.py b/tests/serialize/test_packer.py index b62b061ba..86e715b52 100644 --- a/tests/serialize/test_packer.py +++ b/tests/serialize/test_packer.py @@ -56,7 +56,7 @@ def test_char_packer(vocab): bits = BitArray() bits.seek(0) - byte_str = b'the dog jumped' + byte_str = bytearray(b'the dog jumped') packer.char_codec.encode(byte_str, bits) bits.seek(0) result = [b''] * len(byte_str) diff --git a/tests/spans/test_times.py b/tests/spans/test_times.py index 04182e9c8..1958157f5 100644 --- a/tests/spans/test_times.py +++ b/tests/spans/test_times.py @@ -3,6 +3,7 @@ from __future__ import unicode_literals import pytest +@pytest.mark.models def test_am_pm(en_nlp): numbers = ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12'] variants = ['a.m.', 'am', 'p.m.', 'pm'] @@ -14,7 +15,7 @@ def test_am_pm(en_nlp): tokens = en_nlp(string, merge_mwes=True) assert tokens[4].orth_ == '%s%s%s' % (num, space, var) ents = list(tokens.ents) - assert len(ents) == 1 + assert len(ents) == 1, ents assert ents[0].label_ == 'TIME', string if ents[0].start == 4 and ents[0].end == 5: assert ents[0].orth_ == '%s%s%s' % (num, space, var)