Skip to content

Commit a5853d0

Browse files
committed
refactor: Addressed warning about missing default fixture loop scope in tests/test_event_loop_fixture_finalizer.py.
1 parent 5db6f4f commit a5853d0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/test_event_loop_fixture_finalizer.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55

66
def test_event_loop_fixture_finalizer_returns_fresh_loop_after_test(pytester: Pytester):
7+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
78
pytester.makepyfile(
89
dedent(
910
"""\
@@ -36,6 +37,7 @@ def test_2():
3637
def test_event_loop_fixture_finalizer_handles_loop_set_to_none_sync(
3738
pytester: Pytester,
3839
):
40+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
3941
pytester.makepyfile(
4042
dedent(
4143
"""\
@@ -53,6 +55,7 @@ def test_sync(event_loop):
5355
def test_event_loop_fixture_finalizer_handles_loop_set_to_none_async_without_fixture(
5456
pytester: Pytester,
5557
):
58+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
5659
pytester.makepyfile(
5760
dedent(
5861
"""\
@@ -72,6 +75,7 @@ async def test_async_without_explicit_fixture_request():
7275
def test_event_loop_fixture_finalizer_handles_loop_set_to_none_async_with_fixture(
7376
pytester: Pytester,
7477
):
78+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
7579
pytester.makepyfile(
7680
dedent(
7781
"""\
@@ -94,6 +98,7 @@ async def test_async_with_explicit_fixture_request(event_loop):
9498
def test_event_loop_fixture_finalizer_raises_warning_when_fixture_leaves_loop_unclosed(
9599
pytester: Pytester,
96100
):
101+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
97102
pytester.makepyfile(
98103
dedent(
99104
"""\
@@ -121,6 +126,7 @@ async def test_ends_with_unclosed_loop():
121126
def test_event_loop_fixture_finalizer_raises_warning_when_test_leaves_loop_unclosed(
122127
pytester: Pytester,
123128
):
129+
pytester.makeini("[pytest]\nasyncio_default_fixture_loop_scope = function")
124130
pytester.makepyfile(
125131
dedent(
126132
"""\

0 commit comments

Comments
 (0)