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
5bb89264
Commit
5bb89264
authored
Sep 06, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Still get error messages out (through console)
parent
1bd19e3f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
src/pyodide.js
src/pyodide.js
+3
-1
test/conftest.py
test/conftest.py
+1
-1
test/test_package_loading.py
test/test_package_loading.py
+4
-5
No files found.
src/pyodide.js
View file @
5bb89264
...
...
@@ -125,7 +125,9 @@ var languagePluginLoader = new Promise((resolve, reject) => {
let
loadPackage
=
(
names
)
=>
{
/* We want to make sure that only one loadPackage invocation runs at any
* given time, so this creates a "chain" of promises. */
loadPackagePromise
=
loadPackagePromise
.
then
(()
=>
_loadPackage
(
names
));
loadPackagePromise
=
loadPackagePromise
.
then
(()
=>
_loadPackage
(
names
))
.
catch
((
e
)
=>
console
.
log
(
e
.
to_string
()));
return
loadPackagePromise
;
};
...
...
test/conftest.py
View file @
5bb89264
...
...
@@ -94,7 +94,7 @@ class SeleniumWrapper:
self
.
run_js
(
'window.done = false
\
n
'
+
'pyodide.loadPackage({!r})'
.
format
(
packages
)
+
'.
then
(function() { window.done = true; })'
)
'.
finally
(function() { window.done = true; })'
)
self
.
wait_until_packages_loaded
()
def
wait_until_packages_loaded
(
self
):
...
...
test/test_package_loading.py
View file @
5bb89264
...
...
@@ -18,10 +18,9 @@ def test_load_from_url(selenium_standalone, web_server):
def
test_uri_mismatch
(
selenium_standalone
):
selenium_standalone
.
load_package
(
'pyparsing'
)
with
pytest
.
raises
(
WebDriverException
,
match
=
"URI mismatch, attempting "
"to load package pyparsing"
):
selenium_standalone
.
load_package
(
'http://some_url/pyparsing.js'
)
selenium_standalone
.
load_package
(
'http://some_url/pyparsing.js'
)
assert
(
"URI mismatch, attempting to load package pyparsing"
in
selenium_standalone
.
logs
)
assert
"Invalid package name or URI"
not
in
selenium_standalone
.
logs
...
...
@@ -62,7 +61,7 @@ def test_load_packages_sequential(selenium_standalone, packages):
selenium
.
run_js
(
'window.done = false
\
n
'
+
'Promise.all([{}])'
.
format
(
promises
)
+
'.
then
(function() { window.done = true; })'
)
'.
finally
(function() { window.done = true; })'
)
selenium
.
wait_until_packages_loaded
()
selenium
.
run
(
f'import
{
packages
[
0
]
}
'
)
selenium
.
run
(
f'import
{
packages
[
1
]
}
'
)
...
...
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