From 5efe2f60f223702621e9c9aad7ec99eb50a5b484 Mon Sep 17 00:00:00 2001 From: Ryan Morshead Date: Sat, 9 Dec 2023 16:37:15 -0700 Subject: [PATCH] fix strict equality tests --- src/py/reactpy/tests/test_core/test_hooks.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/py/reactpy/tests/test_core/test_hooks.py b/src/py/reactpy/tests/test_core/test_hooks.py index 3e29eec8c..d95e8d4c1 100644 --- a/src/py/reactpy/tests/test_core/test_hooks.py +++ b/src/py/reactpy/tests/test_core/test_hooks.py @@ -1,4 +1,4 @@ -from asyncio import CancelledError, create_task, sleep, wait_for +from asyncio import CancelledError, TimeoutError, create_task, sleep, wait_for from asyncio import Event as EventNoTimeout import pytest @@ -1213,7 +1213,7 @@ def SomeComponent(): @pytest.mark.parametrize("get_value", STRICT_EQUALITY_VALUE_CONSTRUCTORS) async def test_use_effect_compares_with_strict_equality(get_value): effect_count = reactpy.Ref(0) - value = reactpy.Ref("string") + value = reactpy.Ref(get_value()) hook = HookCatcher() @reactpy.component @@ -1226,7 +1226,7 @@ def incr_effect_count(): async with reactpy.Layout(SomeComponent()) as layout: await layout.render() assert effect_count.current == 1 - value.current = "string" # new string instance but same value + value.current = get_value() hook.latest.schedule_render() await layout.render() # effect does not trigger