Fix #1841 - Provide a better error when input is used (#1857)

This commit is contained in:
Andrea Giammarchi
2023-11-14 15:25:17 +01:00
committed by GitHub
parent e750fa7393
commit 48e3383f66
3 changed files with 48 additions and 1 deletions

View File

@@ -93,6 +93,19 @@ class TestBasic(PyScriptTest):
)
assert self.console.log.lines[-1] == "hello pyscript"
@only_main
def test_input_exception(self):
self.pyscript_run(
"""
<script type="py">
input("what's your name?")
</script>
"""
)
self.check_py_errors(
"Exception: input() doesn't work when PyScript runs in the main thread."
)
@skip_worker("NEXT: exceptions should be displayed in the DOM")
def test_python_exception(self):
self.pyscript_run(