Skip to content

Commit c60ab84

Browse files
committed
Fix hook state failure in Pytest
1 parent 793bd57 commit c60ab84

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/conftest.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@ def rebuild():
4444
subprocess.run(["hatch", "build", "-t", "wheel"], check=True) # noqa: S607, S603
4545

4646

47+
@pytest.fixture(autouse=True, scope="function")
48+
def create_hook_state():
49+
from reactpy.core._life_cycle_hook import _HOOK_STATE
50+
51+
token = _HOOK_STATE.set([])
52+
yield token
53+
_HOOK_STATE.reset(token)
54+
55+
4756
@pytest.fixture
4857
async def display(server, page):
4958
async with DisplayFixture(server, page) as display:

0 commit comments

Comments
 (0)