From 10462816bce5e0ddd470eed50bf048c36b451513 Mon Sep 17 00:00:00 2001 From: ines Date: Tue, 3 Apr 2018 18:51:31 +0200 Subject: [PATCH] Fix tests for Python 2 --- spacy/tests/test_underscore.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/spacy/tests/test_underscore.py b/spacy/tests/test_underscore.py index f1f7dc77a..07105cd18 100644 --- a/spacy/tests/test_underscore.py +++ b/spacy/tests/test_underscore.py @@ -77,9 +77,10 @@ def test_underscore_raises_for_dup(obj): {'default': None, 'method': lambda: None}, {'getter': True}]) def test_underscore_raises_for_invalid(invalid_kwargs): + invalid_kwargs['force'] = True doc = Doc(Vocab(), words=['hello', 'world']) with pytest.raises(ValueError): - doc.set_extension('test', **invalid_kwargs, force=True) + doc.set_extension('test', **invalid_kwargs) @pytest.mark.parametrize('valid_kwargs', [ @@ -89,5 +90,6 @@ def test_underscore_raises_for_invalid(invalid_kwargs): {'default': None}, {'method': lambda: None}]) def test_underscore_accepts_valid(valid_kwargs): + valid_kwargs['force'] = True doc = Doc(Vocab(), words=['hello', 'world']) - doc.set_extension('test', **valid_kwargs, force=True) + doc.set_extension('test', **valid_kwargs)