Pytest hooks not doing anything?
QuLogic opened this issue · 6 comments
My Fedora builds are failing because of test_lazy_auto_backend_selection. However, even with c0bbfcf patched in, that test still runs.
I tried patching pytest_collection_modifyitems to always apply debugskip, yet all tests seemed to be running. I then tried adding a raise at the beginning of the function, and it never failed.
So I'm beginning to wonder if the pytest hooks are being used at all? This is with pytest 7.1.2 if perhaps something changed there to break it.
Strange, this is what I get locally:
$ python run-mpl-test-suite.py --pyargs matplotlib.tests.test_backends_interactive -vsk auto_backend_selection
Test session starts (platform: linux, Python 3.10.5, pytest 7.1.2, pytest-sugar 0.9.4)
cachedir: .pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/antony/src/local/mplcairo/.hypothesis/examples')
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/antony/src/extern/matplotlib/lib
plugins: sugar-0.9.4, hypothesis-6.17.0, cov-3.0.0, napari-plugin-engine-0.2.0, forked-1.4.0, xdist-2.5.0, anyio-3.6.1, benchmark-3.4.1, napari-0.4.15
collecting ...
matplotlib/tests/test_backends_interactive.py::test_lazy_auto_backend_selection s100% ██████████
=================================== short test summary info ====================================
SKIPPED [1] ../../extern/matplotlib/lib/matplotlib/tests/test_backends_interactive.py: Subprocess-based test; cannot patch agg.
Results (0.21s):
1 skipped
116 deselected
so the hook certainly works here. The test is skipped on CI too...
Are you running against installed mplcairo, or an editable install?
It was with an editable install, but I have now tried with a normal install of mplcairo and matplotlib (in a clean venv) and everything works fine too..
I've worked around this by explicitly passing -k not test_backends_interactive to run-mpl-test-suite.py,
Can I close this then? The whole thing is a bit fuzzy to me, sorry...
Closing, as I don't really have anything actionable here :/