Skip to content

Commit 6d73dd2

Browse files
committed
just @run_in_pyodide shoudl work with async
1 parent 64c52cf commit 6d73dd2

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

tests/test_compat.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
44
"""
55

6-
import pytest
76
from pytest_pyodide import run_in_pyodide
87

9-
from micropip._compat import HttpStatusError, fetch_string_and_headers
108

9+
def test_404(selenium_standalone_micropip, httpserver):
10+
@run_in_pyodide
11+
async def _inner_test_404_raise(selenium, url):
12+
import pytest
13+
14+
from micropip._compat import HttpStatusError, fetch_string_and_headers
15+
16+
with pytest.raises(HttpStatusError):
17+
await fetch_string_and_headers(url, {})
1118

12-
@pytest.mark.asyncio
13-
@run_in_pyodide
14-
async def test_404_raise(httpserver):
1519
httpserver.expect_request("/404").respond_with_data(
1620
"Not found", status=404, content_type="text/plain"
1721
)
18-
with pytest.raises(HttpStatusError):
19-
await fetch_string_and_headers(httpserver.url_for("/404"), {})
22+
url_404 = httpserver.url_for("/404")
23+
_inner_test_404_raise(selenium_standalone_micropip, url_404)

0 commit comments

Comments
 (0)