Commit 5bb89264 authored by Michael Droettboom's avatar Michael Droettboom

Still get error messages out (through console)

parent 1bd19e3f
......@@ -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;
};
......
......@@ -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):
......
......@@ -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]}')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment