From ffcaba9017e1ae4c9708e61857eafe31b4727226 Mon Sep 17 00:00:00 2001 From: Ines Montani Date: Thu, 12 Jan 2017 02:10:18 +0100 Subject: [PATCH] Remove old and/or redundant tests --- setup.py | 1 - spacy/tests/parser/test_conjuncts.py | 33 ---------- spacy/tests/print/__init__.py | 0 spacy/tests/print/test_print.py | 98 ---------------------------- spacy/tests/test_pickle.py | 33 ---------- 5 files changed, 165 deletions(-) delete mode 100644 spacy/tests/parser/test_conjuncts.py delete mode 100644 spacy/tests/print/__init__.py delete mode 100644 spacy/tests/print/test_print.py delete mode 100644 spacy/tests/test_pickle.py diff --git a/setup.py b/setup.py index 38e9eb017..1609341b7 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,6 @@ PACKAGES = [ 'spacy.tests.morphology', 'spacy.tests.munge', 'spacy.tests.parser', - 'spacy.tests.print', 'spacy.tests.serialize', 'spacy.tests.spans', 'spacy.tests.tagger', diff --git a/spacy/tests/parser/test_conjuncts.py b/spacy/tests/parser/test_conjuncts.py deleted file mode 100644 index afb8d207e..000000000 --- a/spacy/tests/parser/test_conjuncts.py +++ /dev/null @@ -1,33 +0,0 @@ -"""Test the Token.conjuncts property""" -from __future__ import unicode_literals - -import pytest - - -def orths(tokens): - return [t.orth_ for t in tokens] - - -#def test_simple_two(EN): -# tokens = EN('I lost money and pride.', tag=True, parse=True) -# pride = tokens[4] -# assert orths(pride.conjuncts) == ['money', 'pride'] -# money = tokens[2] -# assert orths(money.conjuncts) == ['money', 'pride'] - - -#def test_comma_three(EN): -# tokens = EN('I found my wallet, phone and keys.') -# keys = tokens[-2] -# assert orths(keys.conjuncts) == ['wallet', 'phone', 'keys'] -# wallet = tokens[3] -# assert orths(wallet.conjuncts) == ['wallet', 'phone', 'keys'] - - -# This is failing due to parse errors -#def test_and_three(): -# tokens = NLU('I found my wallet and phone and keys.') -# keys = tokens[-2] -# assert orths(keys.conjuncts) == ['wallet', 'phone', 'keys'] -# wallet = tokens[3] -# assert orths(wallet.conjuncts) == ['wallet', 'phone', 'keys'] diff --git a/spacy/tests/print/__init__.py b/spacy/tests/print/__init__.py deleted file mode 100644 index e69de29bb..000000000 diff --git a/spacy/tests/print/test_print.py b/spacy/tests/print/test_print.py deleted file mode 100644 index 4740f44e6..000000000 --- a/spacy/tests/print/test_print.py +++ /dev/null @@ -1,98 +0,0 @@ -# -*- coding: utf-8 -*- -import pytest - - -def test_print_doc(EN): - try: - doc = EN(u'I sat down for coffee at the coffee store') - print(doc) - except Exception: - pytest.fail("Printing failed") - - -def test_repr_doc(EN): - try: - doc = EN(u'I sat down for coffee at the coffee store') - print(repr(doc)) - except Exception: - pytest.fail("Printing failed") - - -def test_print_doc_unicode(EN): - try: - doc = EN(u'I sat down for coffee at the café') - print(doc) - except Exception: - pytest.fail("Printing failed") - - -def test_repr_doc_unicode(EN): - try: - doc = EN(u'I sat down for coffee at the café') - print(repr(doc)) - except Exception: - pytest.fail("Printing failed") - - -def test_print_span(EN): - try: - span = EN(u'I sat down for coffee at the coffee store')[-3:] - print(span) - except Exception: - pytest.fail("Printing failed") - - -def test_repr_span(EN): - try: - span = EN(u'I sat down for coffee at the coffee store')[-3:] - print(repr(span)) - except Exception: - pytest.fail("Printing failed") - - -def test_print_span_unicode(EN): - try: - span = EN(u'I sat down for coffee at the café')[-3:] - print(span) - except Exception: - pytest.fail("Printing failed") - - -def test_repr_span_unicode(EN): - try: - span = EN(u'I sat down for coffee at the café')[-3:] - print(repr(span)) - except Exception: - pytest.fail("Printing failed") - - -def test_print_token(EN): - try: - token = EN(u'I sat down for coffee at the coffee store')[-1] - print(token) - except Exception: - pytest.fail("Printing failed") - - -def test_repr_token(EN): - try: - token = EN(u'I sat down for coffee at the coffee store')[-1] - print(repr(token)) - except Exception: - pytest.fail("Printing failed") - - -def test_print_token_unicode(EN): - try: - token = EN(u'I sat down for coffee at the café')[-1] - print(token) - except Exception: - pytest.fail("Printing failed") - - -def test_repr_token_unicode(EN): - try: - token = EN(u'I sat down for coffee at the café')[-1] - print(repr(token)) - except Exception: - pytest.fail("Printing failed") diff --git a/spacy/tests/test_pickle.py b/spacy/tests/test_pickle.py deleted file mode 100644 index d538fd8b8..000000000 --- a/spacy/tests/test_pickle.py +++ /dev/null @@ -1,33 +0,0 @@ -import cloudpickle -import io -import os -import pickle -import pytest -import tempfile - -try: - unicode -except NameError: - unicode = str - -# These cause the addition of temp files, that are then not deleted -#@pytest.mark.models -#def test_pickle_english(EN): -# file_ = io.BytesIO() -# cloudpickle.dump(EN, file_) -# -# file_.seek(0) -# -# loaded = pickle.load(file_) -# assert loaded is not None -# -#@pytest.mark.models -#def test_cloudpickle_to_file(EN): -# f = tempfile.NamedTemporaryFile(delete=False) -# p = cloudpickle.CloudPickler(f) -# p.dump(EN) -# f.close() -# loaded_en = cloudpickle.load(open(f.name, 'rb')) -# os.unlink(f.name) -# doc = loaded_en(unicode('test parse')) -# assert len(doc) == 2