1818 capture_reactpy_logs ,
1919 clear_reactpy_web_modules_dir ,
2020)
21- from tests .tooling .loop import open_event_loop
21+
22+ REACTPY_FEATURE_CONCURRENT_RENDERING .current = True
2223
2324
2425def pytest_addoption (parser : Parser ) -> None :
@@ -30,22 +31,19 @@ def pytest_addoption(parser: Parser) -> None:
3031 )
3132
3233
33- REACTPY_FEATURE_CONCURRENT_RENDERING .current = True
34-
35-
3634@pytest .fixture
3735async def display (server , page ):
3836 async with DisplayFixture (server , page ) as display :
3937 yield display
4038
4139
42- @pytest .fixture ( scope = "session" )
40+ @pytest .fixture
4341async def server ():
4442 async with BackendFixture () as server :
4543 yield server
4644
4745
48- @pytest .fixture ( scope = "session" )
46+ @pytest .fixture
4947async def page (browser ):
5048 pg = await browser .new_page ()
5149 pg .set_default_timeout (REACTPY_TESTING_DEFAULT_TIMEOUT .current * 1000 )
@@ -55,18 +53,18 @@ async def page(browser):
5553 await pg .close ()
5654
5755
58- @pytest .fixture ( scope = "session" )
56+ @pytest .fixture
5957async def browser (pytestconfig : Config ):
6058 async with async_playwright () as pw :
6159 yield await pw .chromium .launch (headless = not bool (pytestconfig .option .headed ))
6260
6361
6462@pytest .fixture (scope = "session" )
65- def event_loop ():
63+ def event_loop_policy ():
6664 if os .name == "nt" : # nocov
67- asyncio .set_event_loop_policy ( asyncio . WindowsProactorEventLoopPolicy () )
68- with open_event_loop () as loop :
69- yield loop
65+ return asyncio .WindowsProactorEventLoopPolicy ()
66+ else :
67+ return asyncio . DefaultEventLoopPolicy ()
7068
7169
7270@pytest .fixture (autouse = True )
0 commit comments