From 3635b88c8997d5e4873b417960f39b7c2cbade96 Mon Sep 17 00:00:00 2001 From: Hood Chatham Date: Mon, 11 Jan 2021 15:20:35 -0800 Subject: [PATCH] Fix mistake in merging #1047 and #1083 (#1121) --- pyodide_build/testing.py | 8 +++++++- src/tests/test_testing.py | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/pyodide_build/testing.py b/pyodide_build/testing.py index 9bd54af2f2e..79a601edbda 100644 --- a/pyodide_build/testing.py +++ b/pyodide_build/testing.py @@ -39,7 +39,13 @@ def inner(selenium): # containing the source. This results in a more helpful # traceback selenium.run_js( - """pyodide._module.pyodide_py.eval_code({!r}, pyodide._module.globals, "last_expr", true, {!r})""".format( + """pyodide._module.pyodide_py.eval_code({!r}, // code + pyodide._module.globals, // globals + pyodide._module.globals, // locals + "last_expr", // return_mode + true, // quiet_trailing_semicolon + {!r} // filename + )""".format( source, inspect.getsourcefile(f) ) ) diff --git a/src/tests/test_testing.py b/src/tests/test_testing.py index 7f8fca304c0..116e6509e16 100644 --- a/src/tests/test_testing.py +++ b/src/tests/test_testing.py @@ -1,7 +1,13 @@ import pathlib +from pyodide_build.testing import run_in_pyodide def test_web_server_secondary(selenium, web_server_secondary): host, port, logs = web_server_secondary assert pathlib.Path(logs).exists() assert selenium.server_port != port + + +@run_in_pyodide +def test_run_in_pyodide(): + pass