From 74b951fe616062c2acd96b79e233882627bcb7de Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Sat, 16 Nov 2019 20:20:53 +0100 Subject: [PATCH] Fix xpassing tests (#4657) * Ignore internal warnings * Un-xfail passing tests * Skip instead of xfail --- spacy/tests/regression/test_issue3001-3500.py | 2 +- spacy/tests/regression/test_issue3880.py | 2 ++ spacy/tests/regression/test_issue4348.py | 2 ++ spacy/tests/test_gold.py | 3 +-- spacy/tests/tokenizer/test_urls.py | 10 ++++------ 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/spacy/tests/regression/test_issue3001-3500.py b/spacy/tests/regression/test_issue3001-3500.py index b883ae67a..d05759c31 100644 --- a/spacy/tests/regression/test_issue3001-3500.py +++ b/spacy/tests/regression/test_issue3001-3500.py @@ -177,7 +177,6 @@ def test_issue3328(en_vocab): assert matched_texts == ["Hello", "how", "you", "doing"] -@pytest.mark.xfail def test_issue3331(en_vocab): """Test that duplicate patterns for different rules result in multiple matches, one per rule. @@ -328,6 +327,7 @@ def test_issue3449(): assert t3[5].text == "I" +@pytest.mark.filterwarnings("ignore::UserWarning") def test_issue3456(): # this crashed because of a padding error in layer.ops.unflatten in thinc nlp = English() diff --git a/spacy/tests/regression/test_issue3880.py b/spacy/tests/regression/test_issue3880.py index 6de373f11..c060473f5 100644 --- a/spacy/tests/regression/test_issue3880.py +++ b/spacy/tests/regression/test_issue3880.py @@ -2,8 +2,10 @@ from __future__ import unicode_literals from spacy.lang.en import English +import pytest +@pytest.mark.filterwarnings("ignore::UserWarning") def test_issue3880(): """Test that `nlp.pipe()` works when an empty string ends the batch. diff --git a/spacy/tests/regression/test_issue4348.py b/spacy/tests/regression/test_issue4348.py index 9391c3529..d2e27d563 100644 --- a/spacy/tests/regression/test_issue4348.py +++ b/spacy/tests/regression/test_issue4348.py @@ -3,8 +3,10 @@ from __future__ import unicode_literals from spacy.lang.en import English from spacy.util import minibatch, compounding +import pytest +@pytest.mark.filterwarnings("ignore::UserWarning") def test_issue4348(): """Test that training the tagger with empty data, doesn't throw errors""" diff --git a/spacy/tests/test_gold.py b/spacy/tests/test_gold.py index 731a1b5c2..fbdb3155b 100644 --- a/spacy/tests/test_gold.py +++ b/spacy/tests/test_gold.py @@ -177,8 +177,7 @@ def test_roundtrip_docs_to_json(): assert cats["BAKING"] == goldparse.cats["BAKING"] -# xfail while we have backwards-compatible alignment -@pytest.mark.xfail +@pytest.mark.skip(reason="skip while we have backwards-compatible alignment") @pytest.mark.parametrize( "tokens_a,tokens_b,expected", [ diff --git a/spacy/tests/tokenizer/test_urls.py b/spacy/tests/tokenizer/test_urls.py index 0e287aada..21e1819b7 100644 --- a/spacy/tests/tokenizer/test_urls.py +++ b/spacy/tests/tokenizer/test_urls.py @@ -55,10 +55,8 @@ URLS_SHOULD_MATCH = [ pytest.param( "chrome-extension://mhjfbmdgcfjbbpaeojofohoefgiehjai", marks=pytest.mark.xfail() ), - pytest.param("http://foo.com/blah_blah_(wikipedia)", marks=pytest.mark.xfail()), - pytest.param( - "http://foo.com/blah_blah_(wikipedia)_(again)", marks=pytest.mark.xfail() - ), + "http://foo.com/blah_blah_(wikipedia)", + "http://foo.com/blah_blah_(wikipedia)_(again)", pytest.param("http://⌘.ws", marks=pytest.mark.xfail()), pytest.param("http://⌘.ws/", marks=pytest.mark.xfail()), pytest.param("http://☺.damowmow.com/", marks=pytest.mark.xfail()), @@ -105,8 +103,8 @@ URLS_SHOULD_NOT_MATCH = [ "NASDAQ:GOOG", "http://-a.b.co", pytest.param("foo.com", marks=pytest.mark.xfail()), - pytest.param("http://1.1.1.1.1", marks=pytest.mark.xfail()), - pytest.param("http://www.foo.bar./", marks=pytest.mark.xfail()), + "http://1.1.1.1.1", + "http://www.foo.bar./", ]