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
ce15a291
Commit
ce15a291
authored
Aug 20, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix matplotlib tests
parent
9245f6f2
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
test/conftest.py
test/conftest.py
+4
-4
test/test_matplotlib.py
test/test_matplotlib.py
+4
-0
No files found.
test/conftest.py
View file @
ce15a291
...
...
@@ -118,8 +118,8 @@ if pytest is not None:
@
pytest
.
fixture
(
params
=
[
'firefox'
,
'chrome'
],
scope
=
'module'
)
def
_selenium_cached
(
request
):
#
intermediary cached selenium instance, this is a copy
#
of the
selenium_standalone to avoid fixture scope issues
#
Cached selenium instance. This is a copy-paste of
# selenium_standalone to avoid fixture scope issues
if
request
.
param
==
'firefox'
:
cls
=
FirefoxWrapper
elif
request
.
param
==
'chrome'
:
...
...
@@ -132,9 +132,9 @@ if pytest is not None:
@
pytest
.
fixture
def
selenium
(
_selenium_cached
):
#
this is
selenium instance cached at the module level
# selenium instance cached at the module level
try
:
#
for each test run, we clean selenium logs
#
clean selenium logs for each test run
_selenium_cached
.
driver
.
execute_script
(
"window.logs = []"
)
yield
_selenium_cached
finally
:
...
...
test/test_matplotlib.py
View file @
ce15a291
def
test_matplotlib
(
selenium
):
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.destroy_all()"
)
def
test_svg
(
selenium
):
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
(
"import io"
)
selenium
.
run
(
"fd = io.BytesIO()"
)
...
...
@@ -14,3 +17,4 @@ def test_svg(selenium):
content
=
selenium
.
run
(
"fd.getvalue().decode('utf8')"
)
assert
len
(
content
)
==
15752
assert
content
.
startswith
(
"<?xml"
)
selenium
.
run
(
"plt.destroy_all()"
)
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