Skip to content

Commit 9cb90f3

Browse files
committed
fix tcl flakiness on windows runners
1 parent faa38bf commit 9cb90f3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/conftest.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
from pathlib import Path
2+
from platform import system
3+
4+
import pytest
5+
from modflow_devtools.misc import is_in_ci
26

37
pytest_plugins = ["modflow_devtools.fixtures"]
48

@@ -8,6 +12,15 @@
812
EXCLUDED_EXAMPLES = []
913

1014

15+
@pytest.fixture(scope="session", autouse=True)
16+
def patch_macos_ci_matplotlib():
17+
# use noninteractive matplotlib backend if in Mac OS CI to avoid pytest-xdist node failure
18+
if is_in_ci() and system().lower() == "darwin":
19+
import matplotlib
20+
21+
matplotlib.use("agg")
22+
23+
1124
def pytest_generate_tests(metafunc):
1225
if "example_script" in metafunc.fixturenames:
1326
scripts = {

0 commit comments

Comments
 (0)