You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After we merge #1760, we have a number of tests which are skipped when running pyscript on the main thread.
I haven't investigated them in details yet, and I suspect/assume that some of them fail for the same/related reasons.
The goal of this issue is to give a rough explanation, try to group them into categories and serve as a starting point for further discussion, and to decide which ones we want to absolutely fix before the final release, and which ones can wait.
I expect that some of them will be uncontroversial, others will require more discussion, so depending on the case we might want to open separate sub-issues for them.
Missing error banner and/or error message
Note: some of these tests explicitly try to locate the .py-error banner. It's probably a good idea to rewrite them to use the self.assert_banner_message() method.
if the user specifies a package which doesn't exist, we should show a nice error in the DOM
self.check_py_errors("Can't fetch metadata for 'i-dont-exist'")
this is similar to the above, but slightly different: in this case, the package exists but cannot be installed because it doesn't have a "pure python wheel". We should probably also write a relevant page in the docs and add a link to it in the error message
PyScript classes exposed an API to access the underlying pyodide from JS: we introduced it because some people requested the funcionality, which was needed for some advanced use case. I have a vague remembering that @JeffersGlass was involved with it, so maybe he remembers more.
If I understand correctly, pyscript next offers another way of achieving the same result. If so, we should just fix/adapt these two tests to use the new functionality and document the difference:
reason="NEXT: pyscript API changed doesn't expose pyscript to window anymore",
allow_module_level=True,
)
classTestInterpreterAccess(PyScriptTest):
"""Test accessing Python objects from JS via pyscript.interpreter"""
Accessing config
Another thing which we have already discussed: I think that now we have an official way to get the config from python, we should rewrite the tests to use that
this is related to the tests above: it tests that we raise an error if we use a non-existent target for output: if we decide to implement output, we should fix this test, and move it somewhere else, because it doesn't make sense to have a test for "warnings and banners" which contains a single test:
pytest.skip(reason="NEXT: Restore the banner", allow_module_level=True)
classTestWarningsAndBanners(PyScriptTest):
# Test the behavior of generated warning banners
deftest_create_singular_warning(self):
# Use a script tag with an invalid output attribute to generate a warning, but only one
self.pyscript_run(
"""
<script type="py" output="foo">
print("one.")
print("two.")
</script>
<script type="py" output="foo">
print("three.")
</script>
"""
)
loc=self.page.locator(".alert-banner")
# Only one banner should appear
assertloc.count() ==1
assert (
loc.text_content()
=='output = "foo" does not match the id of any element on the page.'
)
shadow root?
I have no idea what the following test is testing. It is skipped because Element is gone, but it also seems to test that we attach a shadow root to <py-script>?
My gut feeling is that this is no longer valid with pyscript next and we should just kill the test, but I'll let other people who knows more than me to comment :)
reason="FIX LATER: pyscript NEXT doesn't support the Terminal yet",
allow_module_level=True,
)
classTestPyTerminal(PyScriptTest):
deftest_py_terminal(self):
test_stdio_handling.py: this is very likely related to py-terminal, because in order to implement the terminal, we n
ABE7
eed to understand how we want to handle/redirect the standard streams:
pytest.skip(reason="NEXT: entire stdio should be reviewed", allow_module_level=True)
classTestOutputHandling(PyScriptTest):
# Source of a script to test the TargetedStdio functionality
test_py_repl.py: if we have py-terminal, we can easily offer a text-based REPL. The equivalent of the old py-repl will probably be called py-notebook, but I don't know if we want to have it before the final release or not:
Uh oh!
There was an error while loading. Please reload this page.
After we merge #1760, we have a number of tests which are skipped when running pyscript on the main thread.
I haven't investigated them in details yet, and I suspect/assume that some of them fail for the same/related reasons.
The goal of this issue is to give a rough explanation, try to group them into categories and serve as a starting point for further discussion, and to decide which ones we want to absolutely fix before the final release, and which ones can wait.
I expect that some of them will be uncontroversial, others will require more discussion, so depending on the case we might want to open separate sub-issues for them.
Missing error banner and/or error message
Note: some of these tests explicitly try to locate the
.py-error
banner. It's probably a good idea to rewrite them to use theself.assert_banner_message()
method.if the user specifies a package which doesn't exist, we should show a nice error in the DOM
pyscript/pyscript.core/tests/integration/test_01_basic.py
Lines 206 to 228 in abb4598
this is similar to the above, but slightly different: in this case, the package exists but cannot be installed because it doesn't have a "pure python wheel". We should probably also write a relevant page in the docs and add a link to it in the error message
pyscript/pyscript.core/tests/integration/test_01_basic.py
Lines 230 to 251 in abb4598
if the page contains two
<py-config>
tags, the 2nd is silently ignored. We should at least show a warning in that case:pyscript/pyscript.core/tests/integration/test_py_config.py
Lines 106 to 130 in 03c09f1
if we try to
[[fetch]]
an URL which doesn't exist, we should show a nice error message in the DOMpyscript/pyscript.core/tests/integration/test_py_config.py
Lines 155 to 175 in 03c09f1
Accessing pyodide from JS API
PyScript classes exposed an API to access the underlying pyodide from JS: we introduced it because some people requested the funcionality, which was needed for some advanced use case. I have a vague remembering that @JeffersGlass was involved with it, so maybe he remembers more.
If I understand correctly, pyscript next offers another way of achieving the same result. If so, we should just fix/adapt these two tests to use the new functionality and document the difference:
pyscript/pyscript.core/tests/integration/test_01_basic.py
Lines 296 to 310 in 03c09f1
pyscript/pyscript.core/tests/integration/test_01_basic.py
Lines 312 to 335 in 03c09f1
JS API difference between
<script type="py">
and<py-script>
:I think we have already discussed this one, but I don't remember what was the outcome of the discussion :)
pyscript/pyscript.core/tests/integration/test_01_basic.py
Lines 337 to 355 in 03c09f1
This is an entire test file which is completely skipped and seem to be related:
pyscript/pyscript.core/tests/integration/test_interpreter.py
Lines 5 to 12 in c6aaacd
Accessing config
Another thing which we have already discussed: I think that now we have an official way to get the config from python, we should rewrite the tests to use that
pyscript/pyscript.core/tests/integration/test_py_config.py
Lines 34 to 49 in 03c09f1
pyscript/pyscript.core/tests/integration/test_py_config.py
Lines 51 to 68 in 03c09f1
output and stderr attributes
These tests fail because
output
andstderr
are no longer supported. Do we want to fix it, or we have decided to remove the functionality?pyscript/pyscript.core/tests/integration/test_script_type.py
Lines 97 to 108 in 03c09f1
pyscript/pyscript.core/tests/integration/test_script_type.py
Lines 110 to 124 in 03c09f1
output
: if we decide to implementoutput
, we should fix this test, and move it somewhere else, because it doesn't make sense to have a test for "warnings and banners" which contains a single test:pyscript/pyscript.core/tests/integration/test_warnings_and_banners.py
Lines 5 to 32 in c6aaacd
shadow root?
I have no idea what the following test is testing. It is skipped because
Element
is gone, but it also seems to test that we attach a shadow root to<py-script>
?My gut feeling is that this is no longer valid with pyscript next and we should just kill the test, but I'll let other people who knows more than me to comment :)
pyscript/pyscript.core/tests/integration/test_shadow_root.py
Lines 7 to 32 in 03c09f1
Other functionalities
On top of that, we have some
test_*.py
files which are skipped entirely, because their functionality has not implemented yet in NEXT:test_py_terminal.py
: the consensus seems to be that we surely want py-terminal back before the final release:pyscript/pyscript.core/tests/integration/test_py_terminal.py
Lines 8 to 15 in c6aaacd
test_stdio_handling.py
: this is very likely related to py-terminal, because in order to implement the terminal, we n ABE7 eed to understand how we want to handle/redirect the standard streams:pyscript/pyscript.core/tests/integration/test_stdio_handling.py
Lines 5 to 9 in c6aaacd
test_py_repl.py
: if we have py-terminal, we can easily offer a text-based REPL. The equivalent of the oldpy-repl
will probably be calledpy-notebook
, but I don't know if we want to have it before the final release or not:pyscript/pyscript.core/tests/integration/test_py_repl.py
Lines 7 to 13 in c6aaacd
test_splashscreen.py
: we discussed this elsewhere, I think we should have a splashscreen when we use pyodide:pyscript/pyscript.core/tests/integration/test_splashscreen.py
Lines 6 to 10 in c6aaacd
The text was updated successfully, but these errors were encountered: