Skip to content

Commit b66e2a9

Browse files
committed
run pytester subprocess when matplotlib built with pybind11 v3
1 parent a4c64a5 commit b66e2a9

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,12 @@
77
@pytest.fixture
88
def pytester(testdir):
99
return testdir
10+
11+
12+
def pytest_configure(config):
13+
# Matplotlib versions build with pybind11 3.0.0 or later
14+
# encounter import issues unless run in subprocess mode.
15+
# See: https://github.com/matplotlib/pytest-mpl/issues/248
16+
import matplotlib
17+
if Version(matplotlib.__version__) > Version("3.10.3"):
18+
config.option.runpytest = "subprocess"

0 commit comments

Comments
 (0)