8000 TST: Use importlib for importing in pytest · matplotlib/matplotlib@f2b2ee0 · GitHub
[go: up one dir, main page]

Skip to content < 10000 div data-target="react-partial.reactRoot">

Commit f2b2ee0

Browse files
committed
TST: Use importlib for importing in pytest
This fixes the rewriting so that we get detailed variable information again, which was broken with the move to Meson (which does weird import hacking for editable installs.)
1 parent e5098e0 commit f2b2ee0

File tree

7 files changed

+12
-8
lines changed

7 files changed

+12
-8
lines changed

.github/workflows/cygwin.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ jobs:
242242
shell: bash.exe -eo pipefail -o igncr "{0}"
243243
id: cygwin-run-pytest
244244
run: |
245-
xvfb-run python -mpytest -raR -n auto \
245+
xvfb-run pytest -raR -n auto \
246246
--maxfail=50 --timeout=300 --durations=25 \
247247
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
248248

.github/workflows/tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ jobs:
315315

316316
- name: Run pytest
317317
run: |
318-
python -mpytest -raR -n auto \
318+
pytest -raR -n auto \
319319
--maxfail=50 --timeout=300 --durations=25 \
320320
--cov-report=xml --cov=lib --log-level=DEBUG --color=yes
321321

azure-pipelines.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ stages:
225225
fi
226226
echo "##vso[task.setvariable variable=VS_COVERAGE_TOOL]$TOOL"
227227
fi
228-
PYTHONFAULTHANDLER=1 python -m pytest -raR -n 2 \
228+
PYTHONFAULTHANDLER=1 pytest -raR -n 2 \
229229
--maxfail=50 --timeout=300 --durations=25 \
230230
--junitxml=junit/test-results.xml --cov-report=xml --cov=lib ||
231231
[[ "$PYTHON_VERSION" = 'Pre' ]]

doc/api/prev_api_changes/api_changes_3.5.0/deprecations.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ is thus deprecated as well.
353353
To test an installed copy, be sure to specify both ``matplotlib`` and
354354
``mpl_toolkits`` with ``--pyargs``::
355355

356-
python -m pytest --pyargs matplotlib.tests mpl_toolkits.tests
356+
pytest --pyargs matplotlib.tests mpl_toolkits.tests
357357

358358
See :ref:`testing` for more details.
359359

doc/api/prev_api_changes/api_changes_3.7.0/removals.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ is thus removed as well.
185185
To test an installed copy, be sure to specify both ``matplotlib`` and
186186
``mpl_toolkits`` with ``--pyargs``::
187187

188-
python -m pytest --pyargs matplotlib.tests mpl_toolkits.tests
188+
pytest --pyargs matplotlib.tests mpl_toolkits.tests
189189

190190
See :ref:`testing` for more details.
191191

doc/devel/testing.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Running the tests
3737

3838
In the root directory of your development repository run::
3939

40-
python -m pytest
40+
pytest
4141

4242

4343
pytest can be configured via a lot of `command-line parameters`_. Some
@@ -302,11 +302,12 @@ is necessary for testing ``mpl_toolkits``.
302302

303303
Run the tests
304304
^^^^^^^^^^^^^
305+
305306
To run the all the tests on your installed version of Matplotlib::
306307

307-
python -m pytest --pyargs matplotlib.tests
308+
pytest --pyargs matplotlib.tests
308309

309310
The test discovery scope can be narrowed to single test modules or even single
310311
functions::
311312

312-
python -m pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping
313+
pytest --pyargs matplotlib.tests.test_simplification.py::test_clipping

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,3 +298,6 @@ ignore_messages = [
298298
# `lib/matplotlib/testing/conftest.py`.
299299
minversion = "7.0"
300300
testpaths = ["lib"]
301+
addopts = [
302+
"--import-mode=importlib",
303+
]

0 commit comments

Comments
 (0)
0