@@ -43,20 +43,25 @@ def test_execution_thread(self):
43
43
in_worker = str (in_worker ).lower ()
44
44
assert self .console .log .lines [- 1 ] == f"worker? { in_worker } "
45
45
46
- # TODO: if there's no py-script there are surely no plugins neither
47
- # this test must be discussed or rewritten to make sense now
48
- @pytest .mark .skip (reason = "NEXT: No banner and should also add a WARNING about CORS" )
46
+ @skip_worker ('NEXT: it should show a nice error on the page' )
49
47
def test_no_cors_headers (self ):
50
48
self .disable_cors_headers ()
51
49
self .pyscript_run (
52
50
"""
53
- <!-- we don't really need anything here, we just want to check that
54
- pyscript starts -->
51
+ <script type="py">
52
+ import js
53
+ js.console.log("hello")
54
+ </script>
55
55
""" ,
56
56
wait_for_pyscript = False ,
57
57
)
58
58
assert self .headers == {}
59
- if self .execution_thread == "worker" :
59
+ if self .execution_thread == "main" :
60
+ self .wait_for_pyscript ()
61
+ assert self .console .log .lines == ['hello' ]
62
+ self .assert_no_banners ()
63
+ else :
64
+ # XXX adapt and fix the test
60
65
expected_alert_banner_msg = (
61
66
'(PY1000): When execution_thread is "worker", the site must be cross origin '
62
67
"isolated, but crossOriginIsolated is false. To be cross origin isolated, "
@@ -67,8 +72,7 @@ def test_no_cors_headers(self):
67
72
)
68
73
alert_banner = self .page .wait_for_selector (".alert-banner" )
69
74
assert expected_alert_banner_msg in alert_banner .inner_text ()
70
- else :
71
- self .assert_no_banners ()
75
+
72
76
73
77
def test_print (self ):
74
78
self .pyscript_run (
0 commit comments