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
6cf40c49
Commit
6cf40c49
authored
Nov 28, 2018
by
Michael Droettboom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #254: Continue if package loading fails
parent
de7dd4be
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
1 deletion
+14
-1
src/pyodide.js
src/pyodide.js
+2
-1
test/test_package_loading.py
test/test_package_loading.py
+12
-0
No files found.
src/pyodide.js
View file @
6cf40c49
...
...
@@ -119,7 +119,8 @@ var languagePluginLoader = new Promise((resolve, reject) => {
}
});
}
else
{
console
.
log
(
`Unknown package '
${
package
}
'`
);
console
.
error
(
`Unknown package '
${
package
}
'`
);
return
;
}
}
}
...
...
test/test_package_loading.py
View file @
6cf40c49
...
...
@@ -103,3 +103,15 @@ def test_load_packages_sequential(selenium_standalone, packages):
# ('pyparsing' and 'matplotlib')
assert
selenium
.
logs
.
count
(
f'Loading
{
packages
[
0
]
}
'
)
==
1
assert
selenium
.
logs
.
count
(
f'Loading
{
packages
[
1
]
}
'
)
==
1
def
test_load_handle_failure
(
selenium_standalone
):
selenium
=
selenium_standalone
selenium
.
load_package
(
'pytz'
)
selenium
.
run
(
'import pytz'
)
selenium
.
load_package
(
'pytz2'
)
selenium
.
load_package
(
'pyparsing'
)
assert
'Loading pytz'
in
selenium
.
logs
assert
'Loading pytz2'
in
selenium
.
logs
assert
"Unknown package 'pytz2'"
in
selenium
.
logs
assert
'Loading pyparsing'
in
selenium
.
logs
# <- this fails
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