Skip to content

Commit e890ae9

Browse files
committed
Workaround flaky test setup in Python versions > 3.13.3
1 parent 6eeca14 commit e890ae9

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

tests/unit/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def prepare_test_env(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Callabl
3838
"""
3939

4040
def _prepare_test_env() -> None:
41-
delattr(apify._actor.Actor, '__wrapped__')
41+
if hasattr(apify._actor.Actor, '__wrapped__'):
42+
delattr(apify._actor.Actor, '__wrapped__')
4243
apify._actor._ActorType._is_any_instance_initialized = False
4344

4445
# Set the environment variable for the local storage directory to the temporary path.

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)