From 8bbc6dd9441d03f63ea5bd1effe8e0832130298f Mon Sep 17 00:00:00 2001 From: Elizabeth Seiver Date: Thu, 2 Aug 2018 13:54:37 -0700 Subject: [PATCH 1/2] updates error messages to run pytest instead of tests.py standalone --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index c7b8d6fa6b82..ee38eb7bbed8 100644 --- a/setup.py +++ b/setup.py @@ -121,7 +121,7 @@ class NoopTestCommand(TestCommand): def __init__(self, dist): print("Matplotlib does not support running tests with " - "'python setup.py test'. Please run 'python tests.py'.") + "'python setup.py test'. Please run 'pytest'.") class BuildExtraLibraries(BuildExtCommand): From 9f0325e10f72a9262ecf9eaf9609bbc54813fb20 Mon Sep 17 00:00:00 2001 From: Nelle Varoquaux Date: Sat, 4 Aug 2018 15:08:01 -0700 Subject: [PATCH 2/2] DOC removed all mentions of tests.py --- .appveyor.yml | 2 +- doc/devel/contributing.rst | 2 +- doc/devel/release_guide.rst | 3 ++- doc/devel/testing.rst | 3 ++- tools/triage_tests.py | 2 +- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.appveyor.yml b/.appveyor.yml index 195df7266014..5cdd09539f7e 100644 --- a/.appveyor.yml +++ b/.appveyor.yml @@ -106,7 +106,7 @@ test_script: - python -c "import matplotlib as m; m.use('tkagg'); import matplotlib.pyplot as plt; print(plt.get_backend())" # tests - echo The following args are passed to pytest %PYTEST_ARGS% - - python tests.py %PYTEST_ARGS% + - pytest %PYTEST_ARGS% after_test: # After the tests were a success, build wheels with the static libs diff --git a/doc/devel/contributing.rst b/doc/devel/contributing.rst index 9063529e0e57..b40a46a6fa92 100644 --- a/doc/devel/contributing.rst +++ b/doc/devel/contributing.rst @@ -265,7 +265,7 @@ tools: * Code with a good unittest coverage (at least 70%, better 100%), check with:: python -mpip install coverage - python tests.py --with-coverage + pytest --cov=matplotlib --showlocals -v * No pyflakes warnings, check with:: diff --git a/doc/devel/release_guide.rst b/doc/devel/release_guide.rst index 73d7eb8bea39..48350c79d02b 100644 --- a/doc/devel/release_guide.rst +++ b/doc/devel/release_guide.rst @@ -20,7 +20,8 @@ We use `travis-ci `__ for continuous integration. When preparing for a release, the final tagged commit should be tested locally before it is uploaded:: - python tests.py --processes=8 --process-timeout=300 + pytest -n 8 . + In addition the following two tests should be run and manually inspected:: diff --git a/doc/devel/testing.rst b/doc/devel/testing.rst index b3a191be1fa1..b96eb2f71fe0 100644 --- a/doc/devel/testing.rst +++ b/doc/devel/testing.rst @@ -46,7 +46,8 @@ Running the tests is simple. Make sure you have pytest installed and run:: or:: - python tests.py + pytest . + in the root directory of the distribution. The script takes a set of commands, such as: diff --git a/tools/triage_tests.py b/tools/triage_tests.py index cac1bc38b660..42234632d8f6 100644 --- a/tools/triage_tests.py +++ b/tools/triage_tests.py @@ -376,7 +376,7 @@ def launch(result_images, source): Triage image comparison test failures. If no arguments are provided, it assumes you ran the tests at the -top-level of a source checkout as `python tests.py`. +top-level of a source checkout as `pytest .`. Keys: left/right: Move between test, expected and diff images