Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test_backend_qt4 and test_backend_qt5 cannot be both run #8659

Closed
@anntzer

Description

@anntzer

https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/tests/test_backend_qt4.py and https://github.com/matplotlib/matplotlib/blob/master/lib/matplotlib/tests/test_backend_qt5.py provide some minimal testing of the qt4agg and qt5agg interactive backends, but they are actually never run in the same pytest instance, because they check the version set in qt_compat, which cannot change.

$ pytest -k fig_close -vrs
====================================== test session starts ======================================
platform linux -- Python 3.6.1, pytest-3.1.0, py-1.4.33, pluggy-0.4.0 -- /usr/bin/python
cachedir: .cache
rootdir: /home/antony/src/extern/matplotlib, inifile: pytest.ini
plugins: xdist-1.16.0, pep8-1.0.6, instafail-0.3.0, cov-2.5.1
collected 6727 items / 1 skipped 

lib/matplotlib/tests/test_backend_qt4.py::test_fig_close PASSED
==================================== short test summary info ====================================
SKIP [1] /home/antony/src/extern/matplotlib/lib/matplotlib/tests/test_backend_qt5.py:18: module 'matplotlib.backends.qt_compat' has __version__ '4.12', required is: '5'

===================================== 6726 tests deselected =====================================
===================== 1 passed, 1 skipped, 6726 deselected in 3.22 seconds ======================

The correct solution is probably to run these specific tests in their own subprocess (more specifically, something like "collect all tests that require a specific interactive backend and run them all in the same subprocess").

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions