Skip to content

Commit d03d736

Browse files
committed
TST: correct webagg fallback behavior on headless machine
1 parent 58b8743 commit d03d736

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import subprocess
2+
import sys
3+
import pytest
4+
5+
6+
@pytest.mark.parametrize('backend', ['webagg', 'nbagg'])
7+
def test_webagg_fallback(backend):
8+
test_code = ("import matplotlib.pyplot as plt; " +
9+
"print(plt.get_backend());"
10+
f"assert '{backend}' == plt.get_backend().lower();")
11+
ret = subprocess.call(
12+
[sys.executable, "-c", test_code],
13+
env={"MPLBACKEND": backend, "DISPLAY": ""}
14+
)
15+
16+
assert ret == 0

0 commit comments

Comments
 (0)