FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/lib/matplotlib/tests/test_backend_webagg.py at main · spha-code/matplotlib · GitHub
spha-code
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
lib
/
matplotlib
/
tests
/
test_backend_webagg.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (25 loc) · 938 Bytes
Breadcrumbs
matplotlib
/
lib
/
matplotlib
/
tests
/
test_backend_webagg.py
Copy path
File metadata and controls
32 lines (25 loc) · 938 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import
os
import
sys
import
pytest
import
matplotlib
.
backends
.
backend_webagg_core
from
matplotlib
.
testing
import
subprocess_run_for_testing
@
pytest
.
mark
.
parametrize
(
"backend"
, [
"webagg"
,
"nbagg"
])
def
test_webagg_fallback
(
backend
):
pytest
.
importorskip
(
"tornado"
)
if
backend
==
"nbagg"
:
pytest
.
importorskip
(
"IPython"
)
env
=
dict
(
os
.
environ
)
if
sys
.
platform
!=
"win32"
:
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();"
)
subprocess_run_for_testing
([
sys
.
executable
,
"-c"
,
test_code
],
env
=
env
,
check
=
True
)
def
test_webagg_core_no_toolbar
():
fm
=
matplotlib
.
backends
.
backend_webagg_core
.
FigureManagerWebAgg
assert
fm
.
_toolbar2_class
is
None
Back
|
FazBrowse Home
|
New Git URL