Skip to content

Commit 5171a1a

Browse files
committed
Move GITHUB_ACTIONS out of testing module
1 parent 726cd52 commit 5171a1a

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/reactpy/testing/common.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import asyncio
44
import inspect
5-
import os
65
import time
76
from collections.abc import Awaitable, Callable, Coroutine
87
from functools import wraps
@@ -13,14 +12,12 @@
1312
from reactpy.config import REACTPY_TESTS_DEFAULT_TIMEOUT
1413
from reactpy.core._life_cycle_hook import HOOK_STACK, LifeCycleHook
1514
from reactpy.core.events import EventHandler, to_event_handler_function
16-
from reactpy.utils import str_to_bool
1715

1816
_P = ParamSpec("_P")
1917
_R = TypeVar("_R")
2018

2119

2220
_DEFAULT_POLL_DELAY = 0.1
23-
GITHUB_ACTIONS = str_to_bool(os.getenv("GITHUB_ACTIONS", ""))
2421

2522

2623
class poll(Generic[_R]): # noqa: N801

src/reactpy/utils.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from __future__ import annotations
22

3+
import os
34
import re
45
from collections.abc import Callable, Iterable
56
from importlib import import_module
@@ -16,6 +17,14 @@
1617
_RefValue = TypeVar("_RefValue")
1718
_ModelTransform = Callable[[VdomDict], Any]
1819
_UNDEFINED: Any = object()
20+
GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS", "").lower() in {
21+
"y",
22+
"yes",
23+
"t",
24+
"true",
25+
"on",
26+
"1",
27+
}
1928

2029

2130
class Ref(Generic[_RefValue]):
@@ -309,8 +318,3 @@ def __new__(cls, *args, **kw):
309318
orig = super()
310319
cls._instance = orig.__new__(cls, *args, **kw)
311320
return cls._instance
312-
313-
314-
def str_to_bool(s: str) -> bool:
315-
"""Convert a string to a boolean value."""
316-
return s.lower() in {"y", "yes", "t", "true", "on", "1"}

0 commit comments

Comments
 (0)