Skip to content

Commit dbea183

Browse files
Unset autouse for solipsism loop in tests
Setting autouse has no effect for solipsism event_loop() as the method replaces the event loop for all tests in the file where it is used. Signed-off-by: Daniel Zullo <[email protected]>
1 parent 0836138 commit dbea183

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

tests/actor/test_resampling.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
#
2626

2727

28-
@pytest.fixture(autouse=True)
28+
# Setting 'autouse' has no effect as this method replaces the event loop for all tests in the file.
29+
@pytest.fixture()
2930
def event_loop() -> Iterator[async_solipsism.EventLoop]:
3031
"""Replace the loop with one that doesn't interact with the outside world."""
3132
loop = async_solipsism.EventLoop()

tests/actor/test_run_utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
from frequenz.sdk.actor import actor, run
1515

1616

17-
@pytest.fixture(autouse=True)
17+
# Setting 'autouse' has no effect as this method replaces the event loop for all tests in the file.
18+
@pytest.fixture()
1819
def event_loop() -> Iterator[async_solipsism.EventLoop]:
1920
"""Replace the loop with one that doesn't interact with the outside world."""
2021
loop = async_solipsism.EventLoop()

tests/timeseries/test_resampling.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@
3737
# pylint: disable=too-many-locals,redefined-outer-name
3838

3939

40-
@pytest.fixture(autouse=True)
40+
# Setting 'autouse' has no effect as this method replaces the event loop for all tests in the file.
41+
@pytest.fixture()
4142
def event_loop() -> Iterator[async_solipsism.EventLoop]:
4243
"""Replace the loop with one that doesn't interact with the outside world."""
4344
loop = async_solipsism.EventLoop()

0 commit comments

Comments
 (0)