Skip to content

Commit 0590a05

Browse files
committed
Add some more tests using subprocesses to the subprocess xdist_group
Note: Some of them have been marked flaky - may be worth reconstructing whether that was due to timeouts.
1 parent 13d1e51 commit 0590a05

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@ def check_alt_backend(alt_backend):
238238
@pytest.mark.parametrize("env", _get_testable_interactive_backends())
239239
@pytest.mark.parametrize("toolbar", ["toolbar2", "toolmanager"])
240240
@pytest.mark.flaky(reruns=3)
241+
@pytest.mark.xdist_group(name="subprocess")
241242
def test_interactive_backend(env, toolbar):
242243
if env["MPLBACKEND"] == "macosx":
243244
if toolbar == "toolmanager":
@@ -330,6 +331,7 @@ def _test_thread_impl():
330331

331332
@pytest.mark.parametrize("env", _thread_safe_backends)
332333
@pytest.mark.flaky(reruns=3)
334+
@pytest.mark.xdist_group(name="subprocess")
333335
def test_interactive_thread_safety(env):
334336
proc = _run_helper(_test_thread_impl, timeout=_test_timeout, extra_env=env)
335337
assert proc.stdout.count("CloseEvent") == 1
@@ -349,6 +351,7 @@ def _impl_test_lazy_auto_backend_selection():
349351
assert isinstance(bk, str)
350352

351353

354+
@pytest.mark.xdist_group(name="subprocess")
352355
def test_lazy_auto_backend_selection():
353356
_run_helper(_impl_test_lazy_auto_backend_selection,
354357
timeout=_test_timeout)
@@ -381,6 +384,7 @@ def _implcore():
381384
assert 'PyQt5' in sys.modules or 'pyside2' in sys.modules
382385

383386

387+
@pytest.mark.xdist_group(name="subprocess")
384388
def test_qt5backends_uses_qt5():
385389
qt5_bindings = [
386390
dep for dep in ['PyQt5', 'pyside2']
@@ -414,6 +418,7 @@ def _impl_missing():
414418
plt.switch_backend("qt5agg")
415419

416420

421+
@pytest.mark.xdist_group(name="subprocess")
417422
def test_qt_missing():
418423
_run_helper(_impl_missing, timeout=_test_timeout)
419424

@@ -459,6 +464,7 @@ def qt5_and_qt6_pairs():
459464
sys.platform == "linux" and not _c_internal_utils.display_is_valid(),
460465
reason="$DISPLAY and $WAYLAND_DISPLAY are unset")
461466
@pytest.mark.parametrize('host, mpl', [*qt5_and_qt6_pairs()])
467+
@pytest.mark.xdist_group(name="subprocess")
462468
def test_cross_Qt_imports(host, mpl):
463469
try:
464470
proc = _run_helper(_impl_test_cross_Qt_imports, host, mpl,
@@ -541,6 +547,7 @@ def _lazy_headless():
541547

542548
@pytest.mark.skipif(sys.platform != "linux", reason="this a linux-only test")
543549
@pytest.mark.parametrize("env", _get_testable_interactive_backends())
550+
@pytest.mark.xdist_group(name="subprocess")
544551
def test_lazy_linux_headless(env):
545552
proc = _run_helper(
546553
_lazy_headless,
@@ -618,6 +625,7 @@ def _test_number_of_draws_script():
618625
@pytest.mark.parametrize("env", _blit_backends)
619626
# subprocesses can struggle to get the display, so rerun a few times
620627
@pytest.mark.flaky(reruns=4)
628+
@pytest.mark.xdist_group(name="subprocess")
621629
def test_blitting_events(env):
622630
proc = _run_helper(
623631
_test_number_of_draws_script, timeout=_test_timeout, extra_env=env)
@@ -681,6 +689,7 @@ def _impl_test_interactive_timers():
681689

682690

683691
@pytest.mark.parametrize("env", _get_testable_interactive_backends())
692+
@pytest.mark.xdist_group(name="subprocess")
684693
def test_interactive_timers(env):
685694
if env["MPLBACKEND"] == "gtk3cairo" and os.getenv("CI"):
686695
pytest.skip("gtk3cairo timers do not work in remote CI")

0 commit comments

Comments
 (0)