diff --git a/.travis.yml b/.travis.yml index 957112e92..14d829fd2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,7 +14,7 @@ install: script: - "cat /proc/cpuinfo | grep flags | head -n 1" - "pip install pytest pytest-timeout" - - "python -m pytest --tb=native spacy" + - "python -m pytest tests --tb=native spacy" branches: except: - spacy.io diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8b02b7055..7ddf61658 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -175,12 +175,12 @@ The description text can be very short – we don't want to make this too bureaucratic. Next, create a test file named `test_issue[ISSUE NUMBER].py` in the -[`spacy/tests/regression`](spacy/tests/regression) folder. Test for the bug +[`tests/regression`](tests/regression) folder. Test for the bug you're fixing, and make sure the test fails. Next, add and commit your test file referencing the issue number in the commit message. Finally, fix the bug, make sure your test passes and reference the issue in your commit message. -📖 **For more information on how to add tests, check out the [tests README](spacy/tests/README.md).** +📖 **For more information on how to add tests, check out the [tests README](tests/README.md).** ## Code conventions @@ -425,7 +425,7 @@ spaCy uses the [pytest](http://doc.pytest.org/) framework for testing. For more info on this, see the [pytest documentation](http://docs.pytest.org/en/latest/contents.html). Tests for spaCy modules and classes live in their own directories of the same name. For example, tests for the `Tokenizer` can be found in -[`/spacy/tests/tokenizer`](spacy/tests/tokenizer). To be interpreted and run, +[`tests/tokenizer`](tests/tokenizer). To be interpreted and run, all test files and test functions need to be prefixed with `test_`. When adding tests, make sure to use descriptive names, keep the code short and @@ -440,7 +440,7 @@ you're not actually testing the model performance. If all you need is a `Doc` object with annotations like heads, POS tags or the dependency parse, you can use the `get_doc()` utility function to construct it manually. -📖 **For more guidelines and information on how to add tests, check out the [tests README](spacy/tests/README.md).** +📖 **For more guidelines and information on how to add tests, check out the [tests README](tests/README.md).** ## Updating the website diff --git a/README.md b/README.md index 6bdbc7e46..a0d3585ac 100644 --- a/README.md +++ b/README.md @@ -270,7 +270,7 @@ VS 2010 (Python 3.4) and VS 2015 (Python 3.5). ## Run tests -spaCy comes with an [extensive test suite](spacy/tests). In order to run the +spaCy comes with an [extensive test suite](tests). In order to run the tests, you'll usually want to clone the repository and build spaCy from source. This will also install the required development dependencies and test utilities defined in the `requirements.txt`. diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c5fa563be..30bf3d777 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -88,5 +88,5 @@ jobs: pip install -e . displayName: 'Build and install' - - script: python -m pytest --tb=native spacy + - script: python -m pytest tests --tb=native spacy displayName: 'Run tests' diff --git a/fabfile.py b/fabfile.py index 2ab74ce24..5431dcec8 100644 --- a/fabfile.py +++ b/fabfile.py @@ -3,120 +3,152 @@ from __future__ import unicode_literals, print_function import contextlib from pathlib import Path -from fabric.api import local, lcd, env, settings, prefix +from fabric.api import local, lcd, env from os import path, environ import shutil import sys PWD = path.dirname(__file__) -ENV = environ['VENV_DIR'] if 'VENV_DIR' in environ else '.env' +ENV = environ["VENV_DIR"] if "VENV_DIR" in environ else ".env" VENV_DIR = Path(PWD) / ENV @contextlib.contextmanager -def virtualenv(name, create=False, python='/usr/bin/python3.6'): +def virtualenv(name, create=False, python="/usr/bin/python3.6"): python = Path(python).resolve() env_path = VENV_DIR if create: if env_path.exists(): shutil.rmtree(str(env_path)) - local('{python} -m venv {env_path}'.format(python=python, env_path=VENV_DIR)) + local("{python} -m venv {env_path}".format(python=python, env_path=VENV_DIR)) + def wrapped_local(cmd, env_vars=[], capture=False, direct=False): - return local('source {}/bin/activate && {}'.format(env_path, cmd), - shell='/bin/bash', capture=False) + return local( + "source {}/bin/activate && {}".format(env_path, cmd), + shell="/bin/bash", + capture=False, + ) + yield wrapped_local -def env(lang='python3.6'): +def env(lang="python3.6"): if VENV_DIR.exists(): - local('rm -rf {env}'.format(env=VENV_DIR)) - if lang.startswith('python3'): - local('{lang} -m venv {env}'.format(lang=lang, env=VENV_DIR)) + local("rm -rf {env}".format(env=VENV_DIR)) + if lang.startswith("python3"): + local("{lang} -m venv {env}".format(lang=lang, env=VENV_DIR)) else: - local('{lang} -m pip install virtualenv --no-cache-dir'.format(lang=lang)) - local('{lang} -m virtualenv {env} --no-cache-dir'.format(lang=lang, env=VENV_DIR)) + local("{lang} -m pip install virtualenv --no-cache-dir".format(lang=lang)) + local( + "{lang} -m virtualenv {env} --no-cache-dir".format(lang=lang, env=VENV_DIR) + ) with virtualenv(VENV_DIR) as venv_local: - print(venv_local('python --version', capture=True)) - venv_local('pip install --upgrade setuptools --no-cache-dir') - venv_local('pip install pytest --no-cache-dir') - venv_local('pip install wheel --no-cache-dir') - venv_local('pip install -r requirements.txt --no-cache-dir') - venv_local('pip install pex --no-cache-dir') - + print(venv_local("python --version", capture=True)) + venv_local("pip install --upgrade setuptools --no-cache-dir") + venv_local("pip install pytest --no-cache-dir") + venv_local("pip install wheel --no-cache-dir") + venv_local("pip install -r requirements.txt --no-cache-dir") + venv_local("pip install pex --no-cache-dir") def install(): with virtualenv(VENV_DIR) as venv_local: - venv_local('pip install dist/*.tar.gz') + venv_local("pip install dist/*.tar.gz") def make(): with lcd(path.dirname(__file__)): - local('export PYTHONPATH=`pwd` && source .env/bin/activate && python setup.py build_ext --inplace', - shell='/bin/bash') + local( + "export PYTHONPATH=`pwd` && source .env/bin/activate && python setup.py build_ext --inplace", + shell="/bin/bash", + ) + def sdist(): with virtualenv(VENV_DIR) as venv_local: with lcd(path.dirname(__file__)): - local('python -m pip install -U setuptools srsly') - local('python setup.py sdist') + local("python -m pip install -U setuptools srsly") + local("python setup.py sdist") + def wheel(): with virtualenv(VENV_DIR) as venv_local: with lcd(path.dirname(__file__)): - venv_local('python setup.py bdist_wheel') + venv_local("python setup.py bdist_wheel") + def pex(): with virtualenv(VENV_DIR) as venv_local: with lcd(path.dirname(__file__)): - sha = local('git rev-parse --short HEAD', capture=True) - venv_local('pex dist/*.whl -e spacy -o dist/spacy-%s.pex' % sha, - direct=True) + sha = local("git rev-parse --short HEAD", capture=True) + venv_local( + "pex dist/*.whl -e spacy -o dist/spacy-%s.pex" % sha, direct=True + ) def clean(): with lcd(path.dirname(__file__)): - local('rm -f dist/*.whl') - local('rm -f dist/*.pex') + local("rm -f dist/*.whl") + local("rm -f dist/*.pex") with virtualenv(VENV_DIR) as venv_local: - venv_local('python setup.py clean --all') + venv_local("python setup.py clean --all") def test(): with virtualenv(VENV_DIR) as venv_local: with lcd(path.dirname(__file__)): - venv_local('pytest -x spacy/tests') + venv_local("pytest -x tests") + def train(): - args = environ.get('SPACY_TRAIN_ARGS', '') + args = environ.get("SPACY_TRAIN_ARGS", "") with virtualenv(VENV_DIR) as venv_local: - venv_local('spacy train {args}'.format(args=args)) + venv_local("spacy train {args}".format(args=args)) -def conll17(treebank_dir, experiment_dir, vectors_dir, config, corpus=''): - is_not_clean = local('git status --porcelain', capture=True) +def conll17(treebank_dir, experiment_dir, vectors_dir, config, corpus=""): + is_not_clean = local("git status --porcelain", capture=True) if is_not_clean: print("Repository is not clean") print(is_not_clean) sys.exit(1) - git_sha = local('git rev-parse --short HEAD', capture=True) - config_checksum = local('sha256sum {config}'.format(config=config), capture=True) - experiment_dir = Path(experiment_dir) / '{}--{}'.format(config_checksum[:6], git_sha) + git_sha = local("git rev-parse --short HEAD", capture=True) + config_checksum = local("sha256sum {config}".format(config=config), capture=True) + experiment_dir = Path(experiment_dir) / "{}--{}".format( + config_checksum[:6], git_sha + ) if not experiment_dir.exists(): experiment_dir.mkdir() - test_data_dir = Path(treebank_dir) / 'ud-test-v2.0-conll2017' + test_data_dir = Path(treebank_dir) / "ud-test-v2.0-conll2017" assert test_data_dir.exists() assert test_data_dir.is_dir() if corpus: corpora = [corpus] else: - corpora = ['UD_English', 'UD_Chinese', 'UD_Japanese', 'UD_Vietnamese'] + corpora = ["UD_English", "UD_Chinese", "UD_Japanese", "UD_Vietnamese"] - local('cp {config} {experiment_dir}/config.json'.format(config=config, experiment_dir=experiment_dir)) + local( + "cp {config} {experiment_dir}/config.json".format( + config=config, experiment_dir=experiment_dir + ) + ) with virtualenv(VENV_DIR) as venv_local: for corpus in corpora: - venv_local('spacy ud-train {treebank_dir} {experiment_dir} {config} {corpus} -v {vectors_dir}'.format( - treebank_dir=treebank_dir, experiment_dir=experiment_dir, config=config, corpus=corpus, vectors_dir=vectors_dir)) - venv_local('spacy ud-run-test {test_data_dir} {experiment_dir} {corpus}'.format( - test_data_dir=test_data_dir, experiment_dir=experiment_dir, config=config, corpus=corpus)) + venv_local( + "spacy ud-train {treebank_dir} {experiment_dir} {config} {corpus} -v {vectors_dir}".format( + treebank_dir=treebank_dir, + experiment_dir=experiment_dir, + config=config, + corpus=corpus, + vectors_dir=vectors_dir, + ) + ) + venv_local( + "spacy ud-run-test {test_data_dir} {experiment_dir} {corpus}".format( + test_data_dir=test_data_dir, + experiment_dir=experiment_dir, + config=config, + corpus=corpus, + ) + ) diff --git a/spacy/tests/README.md b/tests/README.md similarity index 52% rename from spacy/tests/README.md rename to tests/README.md index 7aa7f6166..1c1beac81 100644 --- a/spacy/tests/README.md +++ b/tests/README.md @@ -17,7 +17,6 @@ Tests for spaCy modules and classes live in their own directories of the same na 5. [Helpers and utilities](#helpers-and-utilities) 6. [Contributing to the tests](#contributing-to-the-tests) - ## Running the tests To show print statements, run the tests with `py.test -s`. To abort after the @@ -32,26 +31,25 @@ You can also run tests in a specific file or directory, or even only one specific test: ```bash -py.test spacy/tests/tokenizer # run all tests in directory -py.test spacy/tests/tokenizer/test_exceptions.py # run all tests in file -py.test spacy/tests/tokenizer/test_exceptions.py::test_tokenizer_handles_emoji # run specific test +py.test tests/tokenizer # run all tests in directory +py.test tests/tokenizer/test_exceptions.py # run all tests in file +py.test tests/tokenizer/test_exceptions.py::test_tokenizer_handles_emoji # run specific test ``` ## Dos and don'ts To keep the behaviour of the tests consistent and predictable, we try to follow a few basic conventions: -* **Test names** should follow a pattern of `test_[module]_[tested behaviour]`. For example: `test_tokenizer_keeps_email` or `test_spans_override_sentiment`. -* If you're testing for a bug reported in a specific issue, always create a **regression test**. Regression tests should be named `test_issue[ISSUE NUMBER]` and live in the [`regression`](regression) directory. -* Only use `@pytest.mark.xfail` for tests that **should pass, but currently fail**. To test for desired negative behaviour, use `assert not` in your test. -* Very **extensive tests** that take a long time to run should be marked with `@pytest.mark.slow`. If your slow test is testing important behaviour, consider adding an additional simpler version. -* If tests require **loading the models**, they should be added to the [`spacy-models`](https://github.com/explosion/spacy-models) tests. -* Before requiring the models, always make sure there is no other way to test the particular behaviour. In a lot of cases, it's sufficient to simply create a `Doc` object manually. See the section on [helpers and utility functions](#helpers-and-utilities) for more info on this. -* **Avoid unnecessary imports.** There should never be a need to explicitly import spaCy at the top of a file, and many components are available as [fixtures](#fixtures). You should also avoid wildcard imports (`from module import *`). -* If you're importing from spaCy, **always use absolute imports**. For example: `from spacy.language import Language`. -* Don't forget the **unicode declarations** at the top of each file. This way, unicode strings won't have to be prefixed with `u`. -* Try to keep the tests **readable and concise**. Use clear and descriptive variable names (`doc`, `tokens` and `text` are great), keep it short and only test for one behaviour at a time. - +- **Test names** should follow a pattern of `test_[module]_[tested behaviour]`. For example: `test_tokenizer_keeps_email` or `test_spans_override_sentiment`. +- If you're testing for a bug reported in a specific issue, always create a **regression test**. Regression tests should be named `test_issue[ISSUE NUMBER]` and live in the [`regression`](regression) directory. +- Only use `@pytest.mark.xfail` for tests that **should pass, but currently fail**. To test for desired negative behaviour, use `assert not` in your test. +- Very **extensive tests** that take a long time to run should be marked with `@pytest.mark.slow`. If your slow test is testing important behaviour, consider adding an additional simpler version. +- If tests require **loading the models**, they should be added to the [`spacy-models`](https://github.com/explosion/spacy-models) tests. +- Before requiring the models, always make sure there is no other way to test the particular behaviour. In a lot of cases, it's sufficient to simply create a `Doc` object manually. See the section on [helpers and utility functions](#helpers-and-utilities) for more info on this. +- **Avoid unnecessary imports.** There should never be a need to explicitly import spaCy at the top of a file, and many components are available as [fixtures](#fixtures). You should also avoid wildcard imports (`from module import *`). +- If you're importing from spaCy, **always use absolute imports**. For example: `from spacy.language import Language`. +- Don't forget the **unicode declarations** at the top of each file. This way, unicode strings won't have to be prefixed with `u`. +- Try to keep the tests **readable and concise**. Use clear and descriptive variable names (`doc`, `tokens` and `text` are great), keep it short and only test for one behaviour at a time. ## Parameters @@ -64,7 +62,7 @@ def test_tokenizer_keep_urls(tokenizer, text): assert len(tokens) == 1 ``` -This will run the test once for each `text` value. Even if you're only testing one example, it's usually best to specify it as a parameter. This will later make it easier for others to quickly add additional test cases without having to modify the test. +This will run the test once for each `text` value. Even if you're only testing one example, it's usually best to specify it as a parameter. This will later make it easier for others to quickly add additional test cases without having to modify the test. You can also specify parameters as tuples to test with multiple values per test: @@ -81,18 +79,17 @@ To test for combinations of parameters, you can add several `parametrize` marker This will run the test with all combinations of the two parameters `text` and `punct`. **Use this feature sparingly**, though, as it can easily cause unneccessary or undesired test bloat. - ## Fixtures Fixtures to create instances of spaCy objects and other components should only be defined once in the global [`conftest.py`](conftest.py). We avoid having per-directory conftest files, as this can easily lead to confusion. These are the main fixtures that are currently available: -| Fixture | Description | -| --- | --- | -| `tokenizer` | Basic, language-independent tokenizer. Identical to the `xx` language class. | -| `en_tokenizer`, `de_tokenizer`, ... | Creates an English, German etc. tokenizer. | -| `en_vocab` | Creates an instance of the English `Vocab`. | +| Fixture | Description | +| ----------------------------------- | ---------------------------------------------------------------------------- | +| `tokenizer` | Basic, language-independent tokenizer. Identical to the `xx` language class. | +| `en_tokenizer`, `de_tokenizer`, ... | Creates an English, German etc. tokenizer. | +| `en_vocab` | Creates an instance of the English `Vocab`. | The fixtures can be used in all tests by simply setting them as an argument, like this: @@ -107,7 +104,6 @@ If all tests in a file require a specific configuration, or use the same complex Our new test setup comes with a few handy utility functions that can be imported from [`util.py`](util.py). - ### Constructing a `Doc` object manually with `get_doc()` Loading the models is expensive and not necessary if you're not actually testing the model performance. If all you need ia a `Doc` object with annotations like heads, POS tags or the dependency parse, you can use `get_doc()` to construct it manually. @@ -129,15 +125,15 @@ def test_doc_token_api_strings(en_tokenizer): You can construct a `Doc` with the following arguments: -| Argument | Description | -| --- | --- | -| `vocab` | `Vocab` instance to use. If you're tokenizing before creating a `Doc`, make sure to use the tokenizer's vocab. Otherwise, you can also use the `en_vocab` fixture. **(required)** | -| `words` | List of words, for example `[t.text for t in tokens]`. **(required)** | -| `heads` | List of heads as integers. | -| `pos` | List of POS tags as text values. | -| `tag` | List of tag names as text values. | -| `dep` | List of dependencies as text values. | -| `ents` | List of entity tuples with `start`, `end`, `label` (for example `(0, 2, 'PERSON')`). The `label` will be looked up in `vocab.strings[label]`. | +| Argument | Description | +| -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `vocab` | `Vocab` instance to use. If you're tokenizing before creating a `Doc`, make sure to use the tokenizer's vocab. Otherwise, you can also use the `en_vocab` fixture. **(required)** | +| `words` | List of words, for example `[t.text for t in tokens]`. **(required)** | +| `heads` | List of heads as integers. | +| `pos` | List of POS tags as text values. | +| `tag` | List of tag names as text values. | +| `dep` | List of dependencies as text values. | +| `ents` | List of entity tuples with `start`, `end`, `label` (for example `(0, 2, 'PERSON')`). The `label` will be looked up in `vocab.strings[label]`. | Here's how to quickly get these values from within spaCy: @@ -154,12 +150,12 @@ print([(ent.start, ent.end, ent.label_) for ent in doc.ents]) ### Other utilities -| Name | Description | -| --- | --- | -| `apply_transition_sequence(parser, doc, sequence)` | Perform a series of pre-specified transitions, to put the parser in a desired state. | -| `add_vecs_to_vocab(vocab, vectors)` | Add list of vector tuples (`[("text", [1, 2, 3])]`) to given vocab. All vectors need to have the same length. | -| `get_cosine(vec1, vec2)` | Get cosine for two given vectors. | -| `assert_docs_equal(doc1, doc2)` | Compare two `Doc` objects and `assert` that they're equal. Tests for tokens, tags, dependencies and entities. | +| Name | Description | +| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `apply_transition_sequence(parser, doc, sequence)` | Perform a series of pre-specified transitions, to put the parser in a desired state. | +| `add_vecs_to_vocab(vocab, vectors)` | Add list of vector tuples (`[("text", [1, 2, 3])]`) to given vocab. All vectors need to have the same length. | +| `get_cosine(vec1, vec2)` | Get cosine for two given vectors. | +| `assert_docs_equal(doc1, doc2)` | Compare two `Doc` objects and `assert` that they're equal. Tests for tokens, tags, dependencies and entities. | ## Contributing to the tests diff --git a/spacy/tests/__init__.py b/tests/__init__.py similarity index 100% rename from spacy/tests/__init__.py rename to tests/__init__.py diff --git a/spacy/tests/conftest.py b/tests/conftest.py similarity index 100% rename from spacy/tests/conftest.py rename to tests/conftest.py diff --git a/spacy/tests/doc/__init__.py b/tests/doc/__init__.py similarity index 100% rename from spacy/tests/doc/__init__.py rename to tests/doc/__init__.py diff --git a/spacy/tests/doc/test_add_entities.py b/tests/doc/test_add_entities.py similarity index 94% rename from spacy/tests/doc/test_add_entities.py rename to tests/doc/test_add_entities.py index 374c3ddd8..6c69e699a 100644 --- a/spacy/tests/doc/test_add_entities.py +++ b/tests/doc/test_add_entities.py @@ -1,12 +1,12 @@ # coding: utf-8 from __future__ import unicode_literals -from ...pipeline import EntityRecognizer -from ..util import get_doc -from ...tokens import Span - +from spacy.pipeline import EntityRecognizer +from spacy.tokens import Span import pytest +from ..util import get_doc + def test_doc_add_entities_set_ents_iob(en_vocab): text = ["This", "is", "a", "lion"] diff --git a/spacy/tests/doc/test_array.py b/tests/doc/test_array.py similarity index 100% rename from spacy/tests/doc/test_array.py rename to tests/doc/test_array.py diff --git a/spacy/tests/doc/test_creation.py b/tests/doc/test_creation.py similarity index 100% rename from spacy/tests/doc/test_creation.py rename to tests/doc/test_creation.py diff --git a/spacy/tests/doc/test_doc_api.py b/tests/doc/test_doc_api.py similarity index 100% rename from spacy/tests/doc/test_doc_api.py rename to tests/doc/test_doc_api.py diff --git a/spacy/tests/doc/test_morphanalysis.py b/tests/doc/test_morphanalysis.py similarity index 100% rename from spacy/tests/doc/test_morphanalysis.py rename to tests/doc/test_morphanalysis.py diff --git a/spacy/tests/doc/test_pickle_doc.py b/tests/doc/test_pickle_doc.py similarity index 100% rename from spacy/tests/doc/test_pickle_doc.py rename to tests/doc/test_pickle_doc.py diff --git a/spacy/tests/doc/test_retokenize_merge.py b/tests/doc/test_retokenize_merge.py similarity index 100% rename from spacy/tests/doc/test_retokenize_merge.py rename to tests/doc/test_retokenize_merge.py diff --git a/spacy/tests/doc/test_retokenize_split.py b/tests/doc/test_retokenize_split.py similarity index 100% rename from spacy/tests/doc/test_retokenize_split.py rename to tests/doc/test_retokenize_split.py diff --git a/spacy/tests/doc/test_span.py b/tests/doc/test_span.py similarity index 100% rename from spacy/tests/doc/test_span.py rename to tests/doc/test_span.py diff --git a/spacy/tests/doc/test_to_json.py b/tests/doc/test_to_json.py similarity index 100% rename from spacy/tests/doc/test_to_json.py rename to tests/doc/test_to_json.py diff --git a/spacy/tests/doc/test_token_api.py b/tests/doc/test_token_api.py similarity index 100% rename from spacy/tests/doc/test_token_api.py rename to tests/doc/test_token_api.py diff --git a/spacy/tests/doc/test_underscore.py b/tests/doc/test_underscore.py similarity index 100% rename from spacy/tests/doc/test_underscore.py rename to tests/doc/test_underscore.py diff --git a/spacy/tests/lang/__init__.py b/tests/lang/__init__.py similarity index 100% rename from spacy/tests/lang/__init__.py rename to tests/lang/__init__.py diff --git a/spacy/tests/lang/ar/__init__.py b/tests/lang/ar/__init__.py similarity index 100% rename from spacy/tests/lang/ar/__init__.py rename to tests/lang/ar/__init__.py diff --git a/spacy/tests/lang/ar/test_exceptions.py b/tests/lang/ar/test_exceptions.py similarity index 100% rename from spacy/tests/lang/ar/test_exceptions.py rename to tests/lang/ar/test_exceptions.py diff --git a/spacy/tests/lang/ar/test_text.py b/tests/lang/ar/test_text.py similarity index 100% rename from spacy/tests/lang/ar/test_text.py rename to tests/lang/ar/test_text.py diff --git a/spacy/tests/lang/bn/__init__.py b/tests/lang/bn/__init__.py similarity index 100% rename from spacy/tests/lang/bn/__init__.py rename to tests/lang/bn/__init__.py diff --git a/spacy/tests/lang/bn/test_tokenizer.py b/tests/lang/bn/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/bn/test_tokenizer.py rename to tests/lang/bn/test_tokenizer.py diff --git a/spacy/tests/lang/ca/__init__.py b/tests/lang/ca/__init__.py similarity index 100% rename from spacy/tests/lang/ca/__init__.py rename to tests/lang/ca/__init__.py diff --git a/spacy/tests/lang/ca/test_exception.py b/tests/lang/ca/test_exception.py similarity index 100% rename from spacy/tests/lang/ca/test_exception.py rename to tests/lang/ca/test_exception.py diff --git a/spacy/tests/lang/ca/test_prefix_suffix_infix.py b/tests/lang/ca/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/ca/test_prefix_suffix_infix.py rename to tests/lang/ca/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/ca/test_text.py b/tests/lang/ca/test_text.py similarity index 100% rename from spacy/tests/lang/ca/test_text.py rename to tests/lang/ca/test_text.py diff --git a/spacy/tests/lang/da/__init__.py b/tests/lang/da/__init__.py similarity index 100% rename from spacy/tests/lang/da/__init__.py rename to tests/lang/da/__init__.py diff --git a/spacy/tests/lang/da/test_exceptions.py b/tests/lang/da/test_exceptions.py similarity index 100% rename from spacy/tests/lang/da/test_exceptions.py rename to tests/lang/da/test_exceptions.py diff --git a/spacy/tests/lang/da/test_lemma.py b/tests/lang/da/test_lemma.py similarity index 100% rename from spacy/tests/lang/da/test_lemma.py rename to tests/lang/da/test_lemma.py diff --git a/spacy/tests/lang/da/test_prefix_suffix_infix.py b/tests/lang/da/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/da/test_prefix_suffix_infix.py rename to tests/lang/da/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/da/test_text.py b/tests/lang/da/test_text.py similarity index 100% rename from spacy/tests/lang/da/test_text.py rename to tests/lang/da/test_text.py diff --git a/spacy/tests/lang/de/__init__.py b/tests/lang/de/__init__.py similarity index 100% rename from spacy/tests/lang/de/__init__.py rename to tests/lang/de/__init__.py diff --git a/spacy/tests/lang/de/test_exceptions.py b/tests/lang/de/test_exceptions.py similarity index 100% rename from spacy/tests/lang/de/test_exceptions.py rename to tests/lang/de/test_exceptions.py diff --git a/spacy/tests/lang/de/test_lemma.py b/tests/lang/de/test_lemma.py similarity index 100% rename from spacy/tests/lang/de/test_lemma.py rename to tests/lang/de/test_lemma.py diff --git a/spacy/tests/lang/de/test_parser.py b/tests/lang/de/test_parser.py similarity index 100% rename from spacy/tests/lang/de/test_parser.py rename to tests/lang/de/test_parser.py diff --git a/spacy/tests/lang/de/test_prefix_suffix_infix.py b/tests/lang/de/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/de/test_prefix_suffix_infix.py rename to tests/lang/de/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/de/test_text.py b/tests/lang/de/test_text.py similarity index 100% rename from spacy/tests/lang/de/test_text.py rename to tests/lang/de/test_text.py diff --git a/spacy/tests/lang/el/__init__.py b/tests/lang/el/__init__.py similarity index 100% rename from spacy/tests/lang/el/__init__.py rename to tests/lang/el/__init__.py diff --git a/spacy/tests/lang/el/test_exception.py b/tests/lang/el/test_exception.py similarity index 100% rename from spacy/tests/lang/el/test_exception.py rename to tests/lang/el/test_exception.py diff --git a/spacy/tests/lang/el/test_text.py b/tests/lang/el/test_text.py similarity index 100% rename from spacy/tests/lang/el/test_text.py rename to tests/lang/el/test_text.py diff --git a/spacy/tests/lang/en/__init__.py b/tests/lang/en/__init__.py similarity index 100% rename from spacy/tests/lang/en/__init__.py rename to tests/lang/en/__init__.py diff --git a/spacy/tests/lang/en/test_customized_tokenizer.py b/tests/lang/en/test_customized_tokenizer.py similarity index 100% rename from spacy/tests/lang/en/test_customized_tokenizer.py rename to tests/lang/en/test_customized_tokenizer.py diff --git a/spacy/tests/lang/en/test_exceptions.py b/tests/lang/en/test_exceptions.py similarity index 100% rename from spacy/tests/lang/en/test_exceptions.py rename to tests/lang/en/test_exceptions.py diff --git a/spacy/tests/lang/en/test_indices.py b/tests/lang/en/test_indices.py similarity index 100% rename from spacy/tests/lang/en/test_indices.py rename to tests/lang/en/test_indices.py diff --git a/spacy/tests/lang/en/test_noun_chunks.py b/tests/lang/en/test_noun_chunks.py similarity index 100% rename from spacy/tests/lang/en/test_noun_chunks.py rename to tests/lang/en/test_noun_chunks.py diff --git a/spacy/tests/lang/en/test_parser.py b/tests/lang/en/test_parser.py similarity index 100% rename from spacy/tests/lang/en/test_parser.py rename to tests/lang/en/test_parser.py diff --git a/spacy/tests/lang/en/test_prefix_suffix_infix.py b/tests/lang/en/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/en/test_prefix_suffix_infix.py rename to tests/lang/en/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/en/test_punct.py b/tests/lang/en/test_punct.py similarity index 100% rename from spacy/tests/lang/en/test_punct.py rename to tests/lang/en/test_punct.py diff --git a/spacy/tests/lang/en/test_sbd.py b/tests/lang/en/test_sbd.py similarity index 100% rename from spacy/tests/lang/en/test_sbd.py rename to tests/lang/en/test_sbd.py diff --git a/spacy/tests/lang/en/test_tagger.py b/tests/lang/en/test_tagger.py similarity index 100% rename from spacy/tests/lang/en/test_tagger.py rename to tests/lang/en/test_tagger.py diff --git a/spacy/tests/lang/en/test_text.py b/tests/lang/en/test_text.py similarity index 100% rename from spacy/tests/lang/en/test_text.py rename to tests/lang/en/test_text.py diff --git a/spacy/tests/lang/es/__init__.py b/tests/lang/es/__init__.py similarity index 100% rename from spacy/tests/lang/es/__init__.py rename to tests/lang/es/__init__.py diff --git a/spacy/tests/lang/es/test_exception.py b/tests/lang/es/test_exception.py similarity index 100% rename from spacy/tests/lang/es/test_exception.py rename to tests/lang/es/test_exception.py diff --git a/spacy/tests/lang/es/test_text.py b/tests/lang/es/test_text.py similarity index 100% rename from spacy/tests/lang/es/test_text.py rename to tests/lang/es/test_text.py diff --git a/spacy/tests/lang/fi/__init__.py b/tests/lang/fi/__init__.py similarity index 100% rename from spacy/tests/lang/fi/__init__.py rename to tests/lang/fi/__init__.py diff --git a/spacy/tests/lang/fi/test_tokenizer.py b/tests/lang/fi/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/fi/test_tokenizer.py rename to tests/lang/fi/test_tokenizer.py diff --git a/spacy/tests/lang/fr/__init__.py b/tests/lang/fr/__init__.py similarity index 100% rename from spacy/tests/lang/fr/__init__.py rename to tests/lang/fr/__init__.py diff --git a/spacy/tests/lang/fr/test_exceptions.py b/tests/lang/fr/test_exceptions.py similarity index 100% rename from spacy/tests/lang/fr/test_exceptions.py rename to tests/lang/fr/test_exceptions.py diff --git a/spacy/tests/lang/fr/test_lemmatization.py b/tests/lang/fr/test_lemmatization.py similarity index 100% rename from spacy/tests/lang/fr/test_lemmatization.py rename to tests/lang/fr/test_lemmatization.py diff --git a/spacy/tests/lang/fr/test_prefix_suffix_infix.py b/tests/lang/fr/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/fr/test_prefix_suffix_infix.py rename to tests/lang/fr/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/fr/test_text.py b/tests/lang/fr/test_text.py similarity index 100% rename from spacy/tests/lang/fr/test_text.py rename to tests/lang/fr/test_text.py diff --git a/spacy/tests/lang/ga/__init__.py b/tests/lang/ga/__init__.py similarity index 100% rename from spacy/tests/lang/ga/__init__.py rename to tests/lang/ga/__init__.py diff --git a/spacy/tests/lang/ga/test_tokenizer.py b/tests/lang/ga/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/ga/test_tokenizer.py rename to tests/lang/ga/test_tokenizer.py diff --git a/spacy/tests/lang/he/__init__.py b/tests/lang/he/__init__.py similarity index 100% rename from spacy/tests/lang/he/__init__.py rename to tests/lang/he/__init__.py diff --git a/spacy/tests/lang/he/test_tokenizer.py b/tests/lang/he/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/he/test_tokenizer.py rename to tests/lang/he/test_tokenizer.py diff --git a/spacy/tests/lang/hr/test_lemma.py b/tests/lang/hr/test_lemma.py similarity index 100% rename from spacy/tests/lang/hr/test_lemma.py rename to tests/lang/hr/test_lemma.py diff --git a/spacy/tests/lang/hu/__init__.py b/tests/lang/hu/__init__.py similarity index 100% rename from spacy/tests/lang/hu/__init__.py rename to tests/lang/hu/__init__.py diff --git a/spacy/tests/lang/hu/test_tokenizer.py b/tests/lang/hu/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/hu/test_tokenizer.py rename to tests/lang/hu/test_tokenizer.py diff --git a/spacy/tests/lang/id/__init__.py b/tests/lang/id/__init__.py similarity index 100% rename from spacy/tests/lang/id/__init__.py rename to tests/lang/id/__init__.py diff --git a/spacy/tests/lang/id/test_prefix_suffix_infix.py b/tests/lang/id/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/id/test_prefix_suffix_infix.py rename to tests/lang/id/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/id/test_text.py b/tests/lang/id/test_text.py similarity index 100% rename from spacy/tests/lang/id/test_text.py rename to tests/lang/id/test_text.py diff --git a/spacy/tests/lang/it/__init__.py b/tests/lang/it/__init__.py similarity index 100% rename from spacy/tests/lang/it/__init__.py rename to tests/lang/it/__init__.py diff --git a/spacy/tests/lang/it/test_prefix_suffix_infix.py b/tests/lang/it/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/it/test_prefix_suffix_infix.py rename to tests/lang/it/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/ja/__init__.py b/tests/lang/ja/__init__.py similarity index 100% rename from spacy/tests/lang/ja/__init__.py rename to tests/lang/ja/__init__.py diff --git a/spacy/tests/lang/ja/test_lemmatization.py b/tests/lang/ja/test_lemmatization.py similarity index 100% rename from spacy/tests/lang/ja/test_lemmatization.py rename to tests/lang/ja/test_lemmatization.py diff --git a/spacy/tests/lang/ja/test_tokenizer.py b/tests/lang/ja/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/ja/test_tokenizer.py rename to tests/lang/ja/test_tokenizer.py diff --git a/spacy/tests/lang/ko/__init__.py b/tests/lang/ko/__init__.py similarity index 100% rename from spacy/tests/lang/ko/__init__.py rename to tests/lang/ko/__init__.py diff --git a/spacy/tests/lang/ko/test_lemmatization.py b/tests/lang/ko/test_lemmatization.py similarity index 100% rename from spacy/tests/lang/ko/test_lemmatization.py rename to tests/lang/ko/test_lemmatization.py diff --git a/spacy/tests/lang/ko/test_tokenizer.py b/tests/lang/ko/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/ko/test_tokenizer.py rename to tests/lang/ko/test_tokenizer.py diff --git a/spacy/tests/lang/lt/__init__.py b/tests/lang/lt/__init__.py similarity index 100% rename from spacy/tests/lang/lt/__init__.py rename to tests/lang/lt/__init__.py diff --git a/spacy/tests/lang/lt/test_lemmatizer.py b/tests/lang/lt/test_lemmatizer.py similarity index 100% rename from spacy/tests/lang/lt/test_lemmatizer.py rename to tests/lang/lt/test_lemmatizer.py diff --git a/spacy/tests/lang/lt/test_text.py b/tests/lang/lt/test_text.py similarity index 100% rename from spacy/tests/lang/lt/test_text.py rename to tests/lang/lt/test_text.py diff --git a/spacy/tests/lang/nb/__init__.py b/tests/lang/nb/__init__.py similarity index 100% rename from spacy/tests/lang/nb/__init__.py rename to tests/lang/nb/__init__.py diff --git a/spacy/tests/lang/nb/test_tokenizer.py b/tests/lang/nb/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/nb/test_tokenizer.py rename to tests/lang/nb/test_tokenizer.py diff --git a/spacy/tests/lang/nl/__init__.py b/tests/lang/nl/__init__.py similarity index 100% rename from spacy/tests/lang/nl/__init__.py rename to tests/lang/nl/__init__.py diff --git a/spacy/tests/lang/nl/test_lemmatizer.py b/tests/lang/nl/test_lemmatizer.py similarity index 100% rename from spacy/tests/lang/nl/test_lemmatizer.py rename to tests/lang/nl/test_lemmatizer.py diff --git a/spacy/tests/lang/nl/test_text.py b/tests/lang/nl/test_text.py similarity index 100% rename from spacy/tests/lang/nl/test_text.py rename to tests/lang/nl/test_text.py diff --git a/spacy/tests/lang/pl/__init__.py b/tests/lang/pl/__init__.py similarity index 100% rename from spacy/tests/lang/pl/__init__.py rename to tests/lang/pl/__init__.py diff --git a/spacy/tests/lang/pl/test_text.py b/tests/lang/pl/test_text.py similarity index 100% rename from spacy/tests/lang/pl/test_text.py rename to tests/lang/pl/test_text.py diff --git a/spacy/tests/lang/pl/test_tokenizer.py b/tests/lang/pl/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/pl/test_tokenizer.py rename to tests/lang/pl/test_tokenizer.py diff --git a/spacy/tests/lang/pt/__init__.py b/tests/lang/pt/__init__.py similarity index 100% rename from spacy/tests/lang/pt/__init__.py rename to tests/lang/pt/__init__.py diff --git a/spacy/tests/lang/pt/test_text.py b/tests/lang/pt/test_text.py similarity index 100% rename from spacy/tests/lang/pt/test_text.py rename to tests/lang/pt/test_text.py diff --git a/spacy/tests/lang/ro/__init__.py b/tests/lang/ro/__init__.py similarity index 100% rename from spacy/tests/lang/ro/__init__.py rename to tests/lang/ro/__init__.py diff --git a/spacy/tests/lang/ro/test_lemmatizer.py b/tests/lang/ro/test_lemmatizer.py similarity index 100% rename from spacy/tests/lang/ro/test_lemmatizer.py rename to tests/lang/ro/test_lemmatizer.py diff --git a/spacy/tests/lang/ro/test_tokenizer.py b/tests/lang/ro/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/ro/test_tokenizer.py rename to tests/lang/ro/test_tokenizer.py diff --git a/spacy/tests/lang/ru/__init__.py b/tests/lang/ru/__init__.py similarity index 100% rename from spacy/tests/lang/ru/__init__.py rename to tests/lang/ru/__init__.py diff --git a/spacy/tests/lang/ru/test_exceptions.py b/tests/lang/ru/test_exceptions.py similarity index 100% rename from spacy/tests/lang/ru/test_exceptions.py rename to tests/lang/ru/test_exceptions.py diff --git a/spacy/tests/lang/ru/test_lemmatizer.py b/tests/lang/ru/test_lemmatizer.py similarity index 100% rename from spacy/tests/lang/ru/test_lemmatizer.py rename to tests/lang/ru/test_lemmatizer.py diff --git a/spacy/tests/lang/ru/test_text.py b/tests/lang/ru/test_text.py similarity index 100% rename from spacy/tests/lang/ru/test_text.py rename to tests/lang/ru/test_text.py diff --git a/spacy/tests/lang/ru/test_tokenizer.py b/tests/lang/ru/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/ru/test_tokenizer.py rename to tests/lang/ru/test_tokenizer.py diff --git a/spacy/tests/lang/sr/__init__.py b/tests/lang/sr/__init__.py similarity index 100% rename from spacy/tests/lang/sr/__init__.py rename to tests/lang/sr/__init__.py diff --git a/spacy/tests/lang/sr/test_exceptions.py b/tests/lang/sr/test_exceptions.py similarity index 100% rename from spacy/tests/lang/sr/test_exceptions.py rename to tests/lang/sr/test_exceptions.py diff --git a/spacy/tests/lang/sr/test_lemmatizer.py b/tests/lang/sr/test_lemmatizer.py similarity index 100% rename from spacy/tests/lang/sr/test_lemmatizer.py rename to tests/lang/sr/test_lemmatizer.py diff --git a/spacy/tests/lang/sr/test_tokenizer.py b/tests/lang/sr/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/sr/test_tokenizer.py rename to tests/lang/sr/test_tokenizer.py diff --git a/spacy/tests/lang/sv/__init__.py b/tests/lang/sv/__init__.py similarity index 100% rename from spacy/tests/lang/sv/__init__.py rename to tests/lang/sv/__init__.py diff --git a/spacy/tests/lang/sv/test_exceptions.py b/tests/lang/sv/test_exceptions.py similarity index 100% rename from spacy/tests/lang/sv/test_exceptions.py rename to tests/lang/sv/test_exceptions.py diff --git a/spacy/tests/lang/sv/test_lemmatizer.py b/tests/lang/sv/test_lemmatizer.py similarity index 100% rename from spacy/tests/lang/sv/test_lemmatizer.py rename to tests/lang/sv/test_lemmatizer.py diff --git a/spacy/tests/lang/sv/test_prefix_suffix_infix.py b/tests/lang/sv/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/sv/test_prefix_suffix_infix.py rename to tests/lang/sv/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/sv/test_text.py b/tests/lang/sv/test_text.py similarity index 100% rename from spacy/tests/lang/sv/test_text.py rename to tests/lang/sv/test_text.py diff --git a/spacy/tests/lang/sv/test_tokenizer.py b/tests/lang/sv/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/sv/test_tokenizer.py rename to tests/lang/sv/test_tokenizer.py diff --git a/spacy/tests/lang/test_attrs.py b/tests/lang/test_attrs.py similarity index 100% rename from spacy/tests/lang/test_attrs.py rename to tests/lang/test_attrs.py diff --git a/spacy/tests/lang/test_initialize.py b/tests/lang/test_initialize.py similarity index 100% rename from spacy/tests/lang/test_initialize.py rename to tests/lang/test_initialize.py diff --git a/spacy/tests/lang/th/__init__.py b/tests/lang/th/__init__.py similarity index 100% rename from spacy/tests/lang/th/__init__.py rename to tests/lang/th/__init__.py diff --git a/spacy/tests/lang/th/test_tokenizer.py b/tests/lang/th/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/th/test_tokenizer.py rename to tests/lang/th/test_tokenizer.py diff --git a/spacy/tests/lang/tr/__init__.py b/tests/lang/tr/__init__.py similarity index 100% rename from spacy/tests/lang/tr/__init__.py rename to tests/lang/tr/__init__.py diff --git a/spacy/tests/lang/tr/test_lemmatization.py b/tests/lang/tr/test_lemmatization.py similarity index 100% rename from spacy/tests/lang/tr/test_lemmatization.py rename to tests/lang/tr/test_lemmatization.py diff --git a/spacy/tests/lang/tt/__init__.py b/tests/lang/tt/__init__.py similarity index 100% rename from spacy/tests/lang/tt/__init__.py rename to tests/lang/tt/__init__.py diff --git a/spacy/tests/lang/tt/test_tokenizer.py b/tests/lang/tt/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/tt/test_tokenizer.py rename to tests/lang/tt/test_tokenizer.py diff --git a/spacy/tests/lang/uk/__init__.py b/tests/lang/uk/__init__.py similarity index 100% rename from spacy/tests/lang/uk/__init__.py rename to tests/lang/uk/__init__.py diff --git a/spacy/tests/lang/uk/test_tokenizer.py b/tests/lang/uk/test_tokenizer.py similarity index 100% rename from spacy/tests/lang/uk/test_tokenizer.py rename to tests/lang/uk/test_tokenizer.py diff --git a/spacy/tests/lang/uk/test_tokenizer_exc.py b/tests/lang/uk/test_tokenizer_exc.py similarity index 100% rename from spacy/tests/lang/uk/test_tokenizer_exc.py rename to tests/lang/uk/test_tokenizer_exc.py diff --git a/spacy/tests/lang/ur/__init__.py b/tests/lang/ur/__init__.py similarity index 100% rename from spacy/tests/lang/ur/__init__.py rename to tests/lang/ur/__init__.py diff --git a/spacy/tests/lang/ur/test_prefix_suffix_infix.py b/tests/lang/ur/test_prefix_suffix_infix.py similarity index 100% rename from spacy/tests/lang/ur/test_prefix_suffix_infix.py rename to tests/lang/ur/test_prefix_suffix_infix.py diff --git a/spacy/tests/lang/ur/test_text.py b/tests/lang/ur/test_text.py similarity index 100% rename from spacy/tests/lang/ur/test_text.py rename to tests/lang/ur/test_text.py diff --git a/spacy/tests/matcher/__init__.py b/tests/matcher/__init__.py similarity index 100% rename from spacy/tests/matcher/__init__.py rename to tests/matcher/__init__.py diff --git a/spacy/tests/matcher/test_matcher_api.py b/tests/matcher/test_matcher_api.py similarity index 100% rename from spacy/tests/matcher/test_matcher_api.py rename to tests/matcher/test_matcher_api.py diff --git a/spacy/tests/matcher/test_matcher_logic.py b/tests/matcher/test_matcher_logic.py similarity index 100% rename from spacy/tests/matcher/test_matcher_logic.py rename to tests/matcher/test_matcher_logic.py diff --git a/spacy/tests/matcher/test_pattern_validation.py b/tests/matcher/test_pattern_validation.py similarity index 100% rename from spacy/tests/matcher/test_pattern_validation.py rename to tests/matcher/test_pattern_validation.py diff --git a/spacy/tests/matcher/test_phrase_matcher.py b/tests/matcher/test_phrase_matcher.py similarity index 100% rename from spacy/tests/matcher/test_phrase_matcher.py rename to tests/matcher/test_phrase_matcher.py diff --git a/spacy/tests/morphology/__init__.py b/tests/morphology/__init__.py similarity index 100% rename from spacy/tests/morphology/__init__.py rename to tests/morphology/__init__.py diff --git a/spacy/tests/morphology/test_morph_features.py b/tests/morphology/test_morph_features.py similarity index 100% rename from spacy/tests/morphology/test_morph_features.py rename to tests/morphology/test_morph_features.py diff --git a/spacy/tests/parser/__init__.py b/tests/parser/__init__.py similarity index 100% rename from spacy/tests/parser/__init__.py rename to tests/parser/__init__.py diff --git a/spacy/tests/parser/test_add_label.py b/tests/parser/test_add_label.py similarity index 100% rename from spacy/tests/parser/test_add_label.py rename to tests/parser/test_add_label.py diff --git a/spacy/tests/parser/test_arc_eager_oracle.py b/tests/parser/test_arc_eager_oracle.py similarity index 100% rename from spacy/tests/parser/test_arc_eager_oracle.py rename to tests/parser/test_arc_eager_oracle.py diff --git a/spacy/tests/parser/test_ner.py b/tests/parser/test_ner.py similarity index 100% rename from spacy/tests/parser/test_ner.py rename to tests/parser/test_ner.py diff --git a/spacy/tests/parser/test_neural_parser.py b/tests/parser/test_neural_parser.py similarity index 100% rename from spacy/tests/parser/test_neural_parser.py rename to tests/parser/test_neural_parser.py diff --git a/spacy/tests/parser/test_nn_beam.py b/tests/parser/test_nn_beam.py similarity index 100% rename from spacy/tests/parser/test_nn_beam.py rename to tests/parser/test_nn_beam.py diff --git a/spacy/tests/parser/test_nonproj.py b/tests/parser/test_nonproj.py similarity index 100% rename from spacy/tests/parser/test_nonproj.py rename to tests/parser/test_nonproj.py diff --git a/spacy/tests/parser/test_parse.py b/tests/parser/test_parse.py similarity index 100% rename from spacy/tests/parser/test_parse.py rename to tests/parser/test_parse.py diff --git a/spacy/tests/parser/test_parse_navigate.py b/tests/parser/test_parse_navigate.py similarity index 100% rename from spacy/tests/parser/test_parse_navigate.py rename to tests/parser/test_parse_navigate.py diff --git a/spacy/tests/parser/test_preset_sbd.py b/tests/parser/test_preset_sbd.py similarity index 100% rename from spacy/tests/parser/test_preset_sbd.py rename to tests/parser/test_preset_sbd.py diff --git a/spacy/tests/parser/test_space_attachment.py b/tests/parser/test_space_attachment.py similarity index 100% rename from spacy/tests/parser/test_space_attachment.py rename to tests/parser/test_space_attachment.py diff --git a/spacy/tests/pipeline/__init__.py b/tests/pipeline/__init__.py similarity index 100% rename from spacy/tests/pipeline/__init__.py rename to tests/pipeline/__init__.py diff --git a/spacy/tests/pipeline/test_entity_linker.py b/tests/pipeline/test_entity_linker.py similarity index 100% rename from spacy/tests/pipeline/test_entity_linker.py rename to tests/pipeline/test_entity_linker.py diff --git a/spacy/tests/pipeline/test_entity_ruler.py b/tests/pipeline/test_entity_ruler.py similarity index 100% rename from spacy/tests/pipeline/test_entity_ruler.py rename to tests/pipeline/test_entity_ruler.py diff --git a/spacy/tests/pipeline/test_factories.py b/tests/pipeline/test_factories.py similarity index 100% rename from spacy/tests/pipeline/test_factories.py rename to tests/pipeline/test_factories.py diff --git a/spacy/tests/pipeline/test_pipe_methods.py b/tests/pipeline/test_pipe_methods.py similarity index 100% rename from spacy/tests/pipeline/test_pipe_methods.py rename to tests/pipeline/test_pipe_methods.py diff --git a/spacy/tests/pipeline/test_sentencizer.py b/tests/pipeline/test_sentencizer.py similarity index 100% rename from spacy/tests/pipeline/test_sentencizer.py rename to tests/pipeline/test_sentencizer.py diff --git a/spacy/tests/pipeline/test_textcat.py b/tests/pipeline/test_textcat.py similarity index 100% rename from spacy/tests/pipeline/test_textcat.py rename to tests/pipeline/test_textcat.py diff --git a/spacy/tests/regression/__init__.py b/tests/regression/__init__.py similarity index 100% rename from spacy/tests/regression/__init__.py rename to tests/regression/__init__.py diff --git a/spacy/tests/regression/test_issue1-1000.py b/tests/regression/test_issue1-1000.py similarity index 100% rename from spacy/tests/regression/test_issue1-1000.py rename to tests/regression/test_issue1-1000.py diff --git a/spacy/tests/regression/test_issue1001-1500.py b/tests/regression/test_issue1001-1500.py similarity index 100% rename from spacy/tests/regression/test_issue1001-1500.py rename to tests/regression/test_issue1001-1500.py diff --git a/spacy/tests/regression/test_issue1501-2000.py b/tests/regression/test_issue1501-2000.py similarity index 100% rename from spacy/tests/regression/test_issue1501-2000.py rename to tests/regression/test_issue1501-2000.py diff --git a/spacy/tests/regression/test_issue2001-2500.py b/tests/regression/test_issue2001-2500.py similarity index 100% rename from spacy/tests/regression/test_issue2001-2500.py rename to tests/regression/test_issue2001-2500.py diff --git a/spacy/tests/regression/test_issue2501-3000.py b/tests/regression/test_issue2501-3000.py similarity index 100% rename from spacy/tests/regression/test_issue2501-3000.py rename to tests/regression/test_issue2501-3000.py diff --git a/spacy/tests/regression/test_issue3001-3500.py b/tests/regression/test_issue3001-3500.py similarity index 100% rename from spacy/tests/regression/test_issue3001-3500.py rename to tests/regression/test_issue3001-3500.py diff --git a/spacy/tests/regression/test_issue3521.py b/tests/regression/test_issue3521.py similarity index 100% rename from spacy/tests/regression/test_issue3521.py rename to tests/regression/test_issue3521.py diff --git a/spacy/tests/regression/test_issue3526.py b/tests/regression/test_issue3526.py similarity index 100% rename from spacy/tests/regression/test_issue3526.py rename to tests/regression/test_issue3526.py diff --git a/spacy/tests/regression/test_issue3531.py b/tests/regression/test_issue3531.py similarity index 100% rename from spacy/tests/regression/test_issue3531.py rename to tests/regression/test_issue3531.py diff --git a/spacy/tests/regression/test_issue3540.py b/tests/regression/test_issue3540.py similarity index 100% rename from spacy/tests/regression/test_issue3540.py rename to tests/regression/test_issue3540.py diff --git a/spacy/tests/regression/test_issue3549.py b/tests/regression/test_issue3549.py similarity index 100% rename from spacy/tests/regression/test_issue3549.py rename to tests/regression/test_issue3549.py diff --git a/spacy/tests/regression/test_issue3555.py b/tests/regression/test_issue3555.py similarity index 100% rename from spacy/tests/regression/test_issue3555.py rename to tests/regression/test_issue3555.py diff --git a/spacy/tests/regression/test_issue3611.py b/tests/regression/test_issue3611.py similarity index 100% rename from spacy/tests/regression/test_issue3611.py rename to tests/regression/test_issue3611.py diff --git a/spacy/tests/regression/test_issue3625.py b/tests/regression/test_issue3625.py similarity index 100% rename from spacy/tests/regression/test_issue3625.py rename to tests/regression/test_issue3625.py diff --git a/spacy/tests/regression/test_issue3803.py b/tests/regression/test_issue3803.py similarity index 100% rename from spacy/tests/regression/test_issue3803.py rename to tests/regression/test_issue3803.py diff --git a/spacy/tests/regression/test_issue3830.py b/tests/regression/test_issue3830.py similarity index 100% rename from spacy/tests/regression/test_issue3830.py rename to tests/regression/test_issue3830.py diff --git a/spacy/tests/regression/test_issue3839.py b/tests/regression/test_issue3839.py similarity index 100% rename from spacy/tests/regression/test_issue3839.py rename to tests/regression/test_issue3839.py diff --git a/spacy/tests/regression/test_issue3869.py b/tests/regression/test_issue3869.py similarity index 100% rename from spacy/tests/regression/test_issue3869.py rename to tests/regression/test_issue3869.py diff --git a/spacy/tests/regression/test_issue3879.py b/tests/regression/test_issue3879.py similarity index 100% rename from spacy/tests/regression/test_issue3879.py rename to tests/regression/test_issue3879.py diff --git a/spacy/tests/regression/test_issue3880.py b/tests/regression/test_issue3880.py similarity index 100% rename from spacy/tests/regression/test_issue3880.py rename to tests/regression/test_issue3880.py diff --git a/spacy/tests/regression/test_issue3882.py b/tests/regression/test_issue3882.py similarity index 100% rename from spacy/tests/regression/test_issue3882.py rename to tests/regression/test_issue3882.py diff --git a/spacy/tests/regression/test_issue3951.py b/tests/regression/test_issue3951.py similarity index 100% rename from spacy/tests/regression/test_issue3951.py rename to tests/regression/test_issue3951.py diff --git a/spacy/tests/regression/test_issue3959.py b/tests/regression/test_issue3959.py similarity index 100% rename from spacy/tests/regression/test_issue3959.py rename to tests/regression/test_issue3959.py diff --git a/spacy/tests/regression/test_issue3962.py b/tests/regression/test_issue3962.py similarity index 100% rename from spacy/tests/regression/test_issue3962.py rename to tests/regression/test_issue3962.py diff --git a/spacy/tests/regression/test_issue3972.py b/tests/regression/test_issue3972.py similarity index 100% rename from spacy/tests/regression/test_issue3972.py rename to tests/regression/test_issue3972.py diff --git a/spacy/tests/regression/test_issue4002.py b/tests/regression/test_issue4002.py similarity index 100% rename from spacy/tests/regression/test_issue4002.py rename to tests/regression/test_issue4002.py diff --git a/spacy/tests/regression/test_issue4030.py b/tests/regression/test_issue4030.py similarity index 100% rename from spacy/tests/regression/test_issue4030.py rename to tests/regression/test_issue4030.py diff --git a/spacy/tests/regression/test_issue4042.py b/tests/regression/test_issue4042.py similarity index 98% rename from spacy/tests/regression/test_issue4042.py rename to tests/regression/test_issue4042.py index 73872df0b..152cf3cdc 100644 --- a/spacy/tests/regression/test_issue4042.py +++ b/tests/regression/test_issue4042.py @@ -6,10 +6,11 @@ import spacy from spacy.pipeline import EntityRecognizer, EntityRuler from spacy.lang.en import English -from spacy.tests.util import make_tempdir from spacy.tokens import Span from spacy.util import ensure_path +from ..util import make_tempdir + def test_issue4042(): """Test that serialization of an EntityRuler before NER works fine.""" diff --git a/spacy/tests/regression/test_issue4054.py b/tests/regression/test_issue4054.py similarity index 95% rename from spacy/tests/regression/test_issue4054.py rename to tests/regression/test_issue4054.py index 2c9d73751..8a263689c 100644 --- a/spacy/tests/regression/test_issue4054.py +++ b/tests/regression/test_issue4054.py @@ -5,9 +5,10 @@ from spacy.vocab import Vocab import spacy from spacy.lang.en import English -from spacy.tests.util import make_tempdir from spacy.util import ensure_path +from ..util import make_tempdir + def test_issue4054(en_vocab): """Test that a new blank model can be made with a vocab from file, diff --git a/spacy/tests/regression/test_issue4104.py b/tests/regression/test_issue4104.py similarity index 100% rename from spacy/tests/regression/test_issue4104.py rename to tests/regression/test_issue4104.py diff --git a/spacy/tests/regression/test_issue4120.py b/tests/regression/test_issue4120.py similarity index 100% rename from spacy/tests/regression/test_issue4120.py rename to tests/regression/test_issue4120.py diff --git a/spacy/tests/regression/test_issue4133.py b/tests/regression/test_issue4133.py similarity index 100% rename from spacy/tests/regression/test_issue4133.py rename to tests/regression/test_issue4133.py diff --git a/spacy/tests/regression/test_issue4190.py b/tests/regression/test_issue4190.py similarity index 100% rename from spacy/tests/regression/test_issue4190.py rename to tests/regression/test_issue4190.py diff --git a/spacy/tests/regression/test_issue4267.py b/tests/regression/test_issue4267.py similarity index 100% rename from spacy/tests/regression/test_issue4267.py rename to tests/regression/test_issue4267.py diff --git a/spacy/tests/regression/test_issue4272.py b/tests/regression/test_issue4272.py similarity index 100% rename from spacy/tests/regression/test_issue4272.py rename to tests/regression/test_issue4272.py diff --git a/spacy/tests/regression/test_issue4278.py b/tests/regression/test_issue4278.py similarity index 100% rename from spacy/tests/regression/test_issue4278.py rename to tests/regression/test_issue4278.py diff --git a/spacy/tests/regression/test_issue4313.py b/tests/regression/test_issue4313.py similarity index 100% rename from spacy/tests/regression/test_issue4313.py rename to tests/regression/test_issue4313.py diff --git a/spacy/tests/serialize/__init__.py b/tests/serialize/__init__.py similarity index 100% rename from spacy/tests/serialize/__init__.py rename to tests/serialize/__init__.py diff --git a/spacy/tests/serialize/test_serialize_doc.py b/tests/serialize/test_serialize_doc.py similarity index 100% rename from spacy/tests/serialize/test_serialize_doc.py rename to tests/serialize/test_serialize_doc.py diff --git a/spacy/tests/serialize/test_serialize_extension_attrs.py b/tests/serialize/test_serialize_extension_attrs.py similarity index 100% rename from spacy/tests/serialize/test_serialize_extension_attrs.py rename to tests/serialize/test_serialize_extension_attrs.py diff --git a/spacy/tests/serialize/test_serialize_kb.py b/tests/serialize/test_serialize_kb.py similarity index 98% rename from spacy/tests/serialize/test_serialize_kb.py rename to tests/serialize/test_serialize_kb.py index 67fd9f0d4..b19c11864 100644 --- a/spacy/tests/serialize/test_serialize_kb.py +++ b/tests/serialize/test_serialize_kb.py @@ -1,11 +1,11 @@ # coding: utf-8 from __future__ import unicode_literals -from ..util import make_tempdir -from ...util import ensure_path - +from spacy.util import ensure_path from spacy.kb import KnowledgeBase +from ..util import make_tempdir + def test_serialize_kb_disk(en_vocab): # baseline assertions diff --git a/spacy/tests/serialize/test_serialize_language.py b/tests/serialize/test_serialize_language.py similarity index 100% rename from spacy/tests/serialize/test_serialize_language.py rename to tests/serialize/test_serialize_language.py diff --git a/spacy/tests/serialize/test_serialize_pipeline.py b/tests/serialize/test_serialize_pipeline.py similarity index 100% rename from spacy/tests/serialize/test_serialize_pipeline.py rename to tests/serialize/test_serialize_pipeline.py diff --git a/spacy/tests/serialize/test_serialize_tokenizer.py b/tests/serialize/test_serialize_tokenizer.py similarity index 100% rename from spacy/tests/serialize/test_serialize_tokenizer.py rename to tests/serialize/test_serialize_tokenizer.py diff --git a/spacy/tests/serialize/test_serialize_vocab_strings.py b/tests/serialize/test_serialize_vocab_strings.py similarity index 100% rename from spacy/tests/serialize/test_serialize_vocab_strings.py rename to tests/serialize/test_serialize_vocab_strings.py diff --git a/spacy/tests/test_align.py b/tests/test_align.py similarity index 100% rename from spacy/tests/test_align.py rename to tests/test_align.py diff --git a/spacy/tests/test_cli.py b/tests/test_cli.py similarity index 100% rename from spacy/tests/test_cli.py rename to tests/test_cli.py diff --git a/spacy/tests/test_displacy.py b/tests/test_displacy.py similarity index 100% rename from spacy/tests/test_displacy.py rename to tests/test_displacy.py diff --git a/spacy/tests/test_gold.py b/tests/test_gold.py similarity index 100% rename from spacy/tests/test_gold.py rename to tests/test_gold.py diff --git a/spacy/tests/test_json_schemas.py b/tests/test_json_schemas.py similarity index 100% rename from spacy/tests/test_json_schemas.py rename to tests/test_json_schemas.py diff --git a/spacy/tests/test_language.py b/tests/test_language.py similarity index 100% rename from spacy/tests/test_language.py rename to tests/test_language.py diff --git a/spacy/tests/test_misc.py b/tests/test_misc.py similarity index 100% rename from spacy/tests/test_misc.py rename to tests/test_misc.py diff --git a/spacy/tests/test_pickles.py b/tests/test_pickles.py similarity index 100% rename from spacy/tests/test_pickles.py rename to tests/test_pickles.py diff --git a/spacy/tests/test_scorer.py b/tests/test_scorer.py similarity index 100% rename from spacy/tests/test_scorer.py rename to tests/test_scorer.py diff --git a/spacy/tests/tokenizer/__init__.py b/tests/tokenizer/__init__.py similarity index 100% rename from spacy/tests/tokenizer/__init__.py rename to tests/tokenizer/__init__.py diff --git a/spacy/tests/tokenizer/sun.txt b/tests/tokenizer/sun.txt similarity index 100% rename from spacy/tests/tokenizer/sun.txt rename to tests/tokenizer/sun.txt diff --git a/spacy/tests/tokenizer/test_exceptions.py b/tests/tokenizer/test_exceptions.py similarity index 100% rename from spacy/tests/tokenizer/test_exceptions.py rename to tests/tokenizer/test_exceptions.py diff --git a/spacy/tests/tokenizer/test_naughty_strings.py b/tests/tokenizer/test_naughty_strings.py similarity index 100% rename from spacy/tests/tokenizer/test_naughty_strings.py rename to tests/tokenizer/test_naughty_strings.py diff --git a/spacy/tests/tokenizer/test_tokenizer.py b/tests/tokenizer/test_tokenizer.py similarity index 100% rename from spacy/tests/tokenizer/test_tokenizer.py rename to tests/tokenizer/test_tokenizer.py diff --git a/spacy/tests/tokenizer/test_urls.py b/tests/tokenizer/test_urls.py similarity index 100% rename from spacy/tests/tokenizer/test_urls.py rename to tests/tokenizer/test_urls.py diff --git a/spacy/tests/tokenizer/test_whitespace.py b/tests/tokenizer/test_whitespace.py similarity index 100% rename from spacy/tests/tokenizer/test_whitespace.py rename to tests/tokenizer/test_whitespace.py diff --git a/spacy/tests/util.py b/tests/util.py similarity index 100% rename from spacy/tests/util.py rename to tests/util.py diff --git a/spacy/tests/vocab_vectors/__init__.py b/tests/vocab_vectors/__init__.py similarity index 100% rename from spacy/tests/vocab_vectors/__init__.py rename to tests/vocab_vectors/__init__.py diff --git a/spacy/tests/vocab_vectors/test_lexeme.py b/tests/vocab_vectors/test_lexeme.py similarity index 100% rename from spacy/tests/vocab_vectors/test_lexeme.py rename to tests/vocab_vectors/test_lexeme.py diff --git a/spacy/tests/vocab_vectors/test_lookups.py b/tests/vocab_vectors/test_lookups.py similarity index 100% rename from spacy/tests/vocab_vectors/test_lookups.py rename to tests/vocab_vectors/test_lookups.py diff --git a/spacy/tests/vocab_vectors/test_similarity.py b/tests/vocab_vectors/test_similarity.py similarity index 100% rename from spacy/tests/vocab_vectors/test_similarity.py rename to tests/vocab_vectors/test_similarity.py diff --git a/spacy/tests/vocab_vectors/test_stringstore.py b/tests/vocab_vectors/test_stringstore.py similarity index 100% rename from spacy/tests/vocab_vectors/test_stringstore.py rename to tests/vocab_vectors/test_stringstore.py diff --git a/spacy/tests/vocab_vectors/test_vectors.py b/tests/vocab_vectors/test_vectors.py similarity index 100% rename from spacy/tests/vocab_vectors/test_vectors.py rename to tests/vocab_vectors/test_vectors.py diff --git a/spacy/tests/vocab_vectors/test_vocab_api.py b/tests/vocab_vectors/test_vocab_api.py similarity index 100% rename from spacy/tests/vocab_vectors/test_vocab_api.py rename to tests/vocab_vectors/test_vocab_api.py diff --git a/website/docs/usage/adding-languages.md b/website/docs/usage/adding-languages.md index 94d75ea31..097aa9888 100644 --- a/website/docs/usage/adding-languages.md +++ b/website/docs/usage/adding-languages.md @@ -543,7 +543,7 @@ be causing regressions. spaCy uses the [pytest framework](https://docs.pytest.org/en/latest/) for testing. For more details on how the tests are structured and best practices for writing your own tests, see our -[tests documentation](https://github.com/explosion/spaCy/tree/master/spacy/tests). +[tests documentation](https://github.com/explosion/spaCy/tree/master/tests). @@ -551,10 +551,10 @@ writing your own tests, see our It's recommended to always add at least some tests with examples specific to the language. Language tests should be located in -[`tests/lang`](https://github.com/explosion/spaCy/tree/master/spacy/tests/lang) -in a directory named after the language ID. You'll also need to create a fixture -for your tokenizer in the -[`conftest.py`](https://github.com/explosion/spaCy/tree/master/spacy/tests/conftest.py). +[`tests/lang`](https://github.com/explosion/spaCy/tree/master/tests/lang) in a +directory named after the language ID. You'll also need to create a fixture for +your tokenizer in the +[`conftest.py`](https://github.com/explosion/spaCy/tree/master/tests/conftest.py). Always use the [`get_lang_class`](/api/top-level#util.get_lang_class) helper function within the fixture, instead of importing the class at the top of the file. This will load the language data only when it's needed. (Otherwise, _all @@ -567,7 +567,7 @@ def en_tokenizer(): ``` When adding test cases, always -[`parametrize`](https://github.com/explosion/spaCy/tree/master/spacy/tests#parameters) +[`parametrize`](https://github.com/explosion/spaCy/tree/master/tests#parameters) them – this will make it easier for others to add more test cases without having to modify the test itself. You can also add parameter tuples, for example, a test sentence and its expected length, or a list of expected tokens. Here's an diff --git a/website/docs/usage/index.md b/website/docs/usage/index.md index 1d6c0574c..5faefb415 100644 --- a/website/docs/usage/index.md +++ b/website/docs/usage/index.md @@ -197,8 +197,8 @@ official distributions these are: ### Run tests {#run-tests} spaCy comes with an -[extensive test suite](https://github.com/explosion/spaCy/tree/master/spacy/tests). -In order to run the tests, you'll usually want to clone the +[extensive test suite](https://github.com/explosion/spaCy/tree/master/tests). In +order to run the tests, you'll usually want to clone the [repository](https://github.com/explosion/spaCy/tree/master/) and [build spaCy from source](#source). This will also install the required development dependencies and test utilities defined in the `requirements.txt`.