Skip to content
File

Blob: src/workerd/server/tests/python/pytest/main.py

python22 lines
1import os
2 
3import pytest
4from workers import WorkerEntrypoint
5 
6from pyodide.webloop import WebLoop
7 
8 
9async def noop(*args):
10 pass
11 
12 
13# pytest-asyncio relies on these but in Pyodide < 0.29 WebLoop does not implement them
14WebLoop.shutdown_asyncgens = noop
15WebLoop.shutdown_default_executor = noop
16 
17 
18class Default(WorkerEntrypoint):
19 async def test(self):
20 os.chdir("/session/metadata/tests")
21 assert pytest.main([".", "-vv"]) == 0