mirror of https://github.com/pyodide/pyodide.git
Fix core CPython tests
This commit is contained in:
parent
9579aa99bc
commit
0ef811c94d
|
@ -150,19 +150,12 @@ def test_open_url(selenium):
|
|||
|
||||
|
||||
def test_run_core_python_test(python_test, selenium):
|
||||
selenium.run(
|
||||
"import sys\n"
|
||||
"exitcode = -1\n"
|
||||
"def exit(n=0):\n"
|
||||
" global exitcode\n"
|
||||
" exitcode = n\n"
|
||||
" raise SystemExit()\n\n"
|
||||
"sys.exit = exit\n")
|
||||
selenium.run(
|
||||
"from test.libregrtest import main\n"
|
||||
"main(['{}'], verbose=True, verbose3=True)".format(python_test))
|
||||
exitcode = selenium.run("exitcode")
|
||||
assert exitcode == 0
|
||||
try:
|
||||
selenium.run(
|
||||
"from test.libregrtest import main\n"
|
||||
"main(['{}'], verbose=True, verbose3=True)".format(python_test))
|
||||
except JavascriptException as e:
|
||||
assert str(e).strip().endswith('SystemExit: 0')
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
|
|
Loading…
Reference in New Issue