Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
2f3a727e
Commit
2f3a727e
authored
Feb 21, 2019
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for wasm_backend. Fix PDF test.
parent
45d14492
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
5 deletions
+7
-5
packages/matplotlib/src/wasm_backend.py
packages/matplotlib/src/wasm_backend.py
+4
-1
test/test_matplotlib.py
test/test_matplotlib.py
+3
-4
No files found.
packages/matplotlib/src/wasm_backend.py
View file @
2f3a727e
...
...
@@ -104,7 +104,10 @@ class FigureCanvasWasm(backend_agg.FigureCanvasAgg):
# Designed to be overridden by subclasses for use in contexts other
# than iodide.
from
js
import
iodide
return
iodide
.
output
.
element
(
'div'
)
if
iodide
is
not
None
:
return
iodide
.
output
.
element
(
'div'
)
else
:
return
document
.
createElement
(
'div'
)
def
show
(
self
):
# If we've already shown this canvas elsewhere, don't create a new one,
...
...
test/test_matplotlib.py
View file @
2f3a727e
def
test_matplotlib
(
selenium
):
def
test_matplotlib
(
selenium_standalone
):
selenium
=
selenium_standalone
selenium
.
load_package
(
"matplotlib"
)
selenium
.
run
(
"from matplotlib import pyplot as plt"
)
selenium
.
run
(
"plt.figure()"
)
selenium
.
run
(
"
x =
plt.plot([1,2,3])"
)
selenium
.
run
(
"plt.plot([1,2,3])"
)
selenium
.
run
(
"plt.show()"
)
...
...
@@ -27,5 +28,3 @@ def test_pdf(selenium):
selenium
.
run
(
"import io"
)
selenium
.
run
(
"fd = io.BytesIO()"
)
selenium
.
run
(
"plt.savefig(fd, format='pdf')"
)
content
=
selenium
.
run
(
"fd.getvalue()"
)
assert
len
(
content
)
==
5559
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment