-
-
Notifications
You must be signed in to change notification settings - Fork 8.1k
FIX: do not consider webagg and nbagg "interactive" for fallback #15512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
dopplershift
merged 6 commits into
matplotlib:master
from
tacaswell:fix_webagg_fallback
Oct 31, 2019
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
a4ffb68
FIX: do not consider webagg and nbagg "interactive" for fallback
tacaswell 0eaa2db
MNT: use set rather than list comprehension to filter backend list
tacaswell f6279ac
TST: correct webagg fallback behavior on headless machine
tacaswell 8271e61
TST: try to fix windows by directly setting mplbackend env
tacaswell fd9f102
TST: skip the nbagg test if we don't have IPython installed
tacaswell 557e56f
TST: fix sub process usage on windows
tacaswell File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
lib/matplotlib/tests/test_backend_webagg.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import subprocess | ||
import os | ||
import sys | ||
import pytest | ||
|
||
|
||
@pytest.mark.parametrize("backend", ["webagg", "nbagg"]) | ||
def test_webagg_fallback(backend): | ||
if backend == "nbagg": | ||
pytest.importorskip("IPython") | ||
env = {} | ||
if os.name == "nt": | ||
env = dict(os.environ) | ||
else: | ||
env = {"DISPLAY": ""} | ||
|
||
env["MPLBACKEND"] = backend | ||
|
||
test_code = ( | ||
"import os;" | ||
+ f"assert os.environ['MPLBACKEND'] == '{backend}';" | ||
+ "import matplotlib.pyplot as plt; " | ||
+ "print(plt.get_backend());" | ||
f"assert '{backend}' == plt.get_backend().lower();" | ||
) | ||
ret = subprocess.call([sys.executable, "-c", test_code], env=env) | ||
|
||
assert ret == 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.