From 95063ba26b0baad65486b8d5b355bb3cebf9f6ae Mon Sep 17 00:00:00 2001 From: ines Date: Wed, 3 Jan 2018 16:42:26 +0100 Subject: [PATCH] Update tests documentation (resolves #1781) --- website/usage/_install/_instructions.jade | 27 ++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/website/usage/_install/_instructions.jade b/website/usage/_install/_instructions.jade index 21b0533eb..66c60da32 100644 --- a/website/usage/_install/_instructions.jade +++ b/website/usage/_install/_instructions.jade @@ -207,14 +207,26 @@ p p | spaCy comes with an #[+a(gh("spacy", "spacy/tests")) extensive test suite]. - | First, find out where spaCy is installed: + | In order to run the tests, you'll usually want to clone the + | #[+a(gh("spacy")) repository] and #[+a("#source") build spaCy from source]. + | This will also install the required development dependencies and test + | utilities defined in the #[code requirements.txt]. + +p + | Alternatively, you can find out where spaCy is installed and run + | #[code pytest] on that directory. Don't forget to also install the + | test utilities via spaCy's + | #[+a(gh("spacy", "requirements.txt")) #[code requirements.txt]]: +code(false, "bash"). python -c "import os; import spacy; print(os.path.dirname(spacy.__file__))" + pip install -r path/to/requirements.txt + python -m pytest <spacy-directory> p - | Then run #[code pytest] on that directory. The flags #[code --slow] and - | #[code --model] are optional and enable additional tests. + | Calling #[code pytest] on the spaCy directory will run only the basic + | tests. The flags #[code --slow] and #[code --model] are optional and + | enable additional tests that take longer or use specific models. +code(false, "bash"). # make sure you are using recent pytest version @@ -224,3 +236,12 @@ p python -m pytest <spacy-directory> --slow # basic and slow tests python -m pytest <spacy-directory> --models --all # basic and all model tests python -m pytest <spacy-directory> --models --en # basic and English model tests + ++infobox("Note on model tests", "⚠️") + | The test suite specifies a #[+a(gh("spacy", "tests/conftest.py")) list of models] + | to run the tests on. If a model is not installed, the tests will be + | skipped. If all models are installed, the respective tests will run once + | for each model. The easiest way to find out which models and model + | versions are available in your current environment is to run + | #[+a("/api/cli#validate") #[code python -m spacy validate]]. This will + | also show whether an installed model is out of date, and how to update it.