Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[Worker support] Error handling and warnings #1381

Copy link
Copy link
Open
@antocuni

Description

@antocuni
Issue body actions

This is a follow-up of #1333 (once it's merged).

It seems that for some reason, error and warning banners don't appear when we run in a worker. There are 3 tests which are skipped because of that:

@skip_worker("FIXME: the banner doesn't appear")
def test_non_existent_package(self):
self.pyscript_run(
"""
<py-config>
packages = ["nonexistendright"]
</py-config>
""",
wait_for_pyscript=False,
)
expected_alert_banner_msg = (
"(PY1001): Unable to install package(s) 'nonexistendright'. "
"Unable to find package in PyPI. Please make sure you have "
"entered a correct package name."
)
alert_banner = self.page.wait_for_selector(".alert-banner")
assert expected_alert_banner_msg in alert_banner.inner_text()

@skip_worker("FIXME: the banner doesn't appear")
def test_no_python_wheel(self):
self.pyscript_run(
"""
<py-config>
packages = ["opsdroid"]
</py-config>
""",
wait_for_pyscript=False,
)
expected_alert_banner_msg = (
"(PY1001): Unable to install package(s) 'opsdroid'. "
"Reason: Can't find a pure Python 3 Wheel for package(s) 'opsdroid'"
)
alert_banner = self.page.wait_for_selector(".alert-banner")
assert expected_alert_banner_msg in alert_banner.inner_text()

@skip_worker("FIXME: showWarning()")
def test_assert_no_banners(self):
"""
Test that the DOM doesn't contain error/warning banners
"""
self.pyscript_run(
"""
<py-script>
from _pyscript_js import showWarning
showWarning("hello")
showWarning("world")
</py-script>
"""
)
with pytest.raises(AssertionError, match="Found 2 alert banners"):
self.assert_no_banners()

Metadata

Metadata

Assignees

No one assigned

    Labels

    classicIssues only applicable to PyScript versions 2023.05.1 and earlier ("PyScript Classic")Issues only applicable to PyScript versions 2023.05.1 and earlier ("PyScript Classic")

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.