File tree 7 files changed +19
-9
lines changed
7 files changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -242,7 +242,7 @@ jobs:
242
242
shell : bash.exe -eo pipefail -o igncr "{0}"
243
243
id : cygwin-run-pytest
244
244
run : |
245
- xvfb-run python -mpytest -raR -n auto \
245
+ xvfb-run pytest -raR -n auto \
246
246
--maxfail=50 --timeout=300 --durations=25 \
247
247
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
248
248
Original file line number Diff line number Diff line change @@ -316,7 +316,7 @@ jobs:
316
316
317
317
- name : Run pytest
318
318
run : |
319
- python -mpytest -raR -n auto \
319
+ pytest -raR -n auto \
320
320
--maxfail=50 --timeout=300 --durations=25 \
321
321
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
322
322
Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ stages:
225
225
fi
226
226
echo "##vso[task.setvariable variable=VS_COVERAGE_TOOL]$TOOL"
227
227
fi
228
- PYTHONFAULTHANDLER=1 python -m pytest -raR -n 2 \
228
+ PYTHONFAULTHANDLER=1 pytest -raR -n 2 \
229
229
--maxfail=50 --timeout=300 --durations=25 \
230
230
--junitxml=junit/test-results.xml --cov-report=xml --cov=lib ||
231
231
[[ "$PYTHON_VERSION" = 'Pre' ]]
Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ is thus deprecated as well.
353
353
To test an installed copy, be sure to specify both ``matplotlib `` and
354
354
``mpl_toolkits `` with ``--pyargs ``::
355
355
356
- python -m pytest --pyargs matplotlib.tests mpl_toolkits.tests
356
+ pytest --pyargs matplotlib.tests mpl_toolkits.tests
357
357
358
358
See :ref: `testing ` for more details.
359
359
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ is thus removed as well.
185
185
To test an installed copy, be sure to specify both ``matplotlib `` and
186
186
``mpl_toolkits `` with ``--pyargs ``::
187
187
188
- python -m pytest --pyargs matplotlib.tests mpl_toolkits.tests
188
+ pytest --pyargs matplotlib.tests mpl_toolkits.tests
189
189
190
190
See :ref: `testing ` for more details.
191
191
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ Running the tests
37
37
38
38
In the root directory of your development repository run::
39
39
40
- python -m pytest
40
+ pytest
41
41
42
42
43
43
pytest can be configured via a lot of `command-line parameters `_. Some
@@ -302,11 +302,18 @@ is necessary for testing ``mpl_toolkits``.
302
302
303
303
Run the tests
304
304
^^^^^^^^^^^^^
305
- To run the all the tests on your installed version of Matplotlib::
306
305
307
- python -m pytest --pyargs matplotlib.tests
306
+ To run all the tests on your installed version of Matplotlib::
307
+
308
+ pytest --pyargs matplotlib.tests
308
309
309
310
The test discovery scope can be narrowed to single test modules or even single
310
311
functions::
311
312
312
- python -m pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping
313
+ pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping
314
+
315
+ If you want to use pytest as a module, then you will need to set its import mode to the
316
+ older ``prepend `` mode (this is because ``python -m `` will add the current directory to
317
+ ``PYTHONPATH `` causing conflicts within pytest)::
318
+
319
+ python -m pytest --import-mode prepend
Original file line number Diff line number Diff line change @@ -298,3 +298,6 @@ ignore_messages = [
298
298
# `lib/matplotlib/testing/conftest.py`.
299
299
minversion = " 7.0"
300
300
testpaths = [" lib" ]
301
+ addopts = [
302
+ " --import-mode=importlib" ,
303
+ ]
You can’t perform that action at this time.
0 commit comments