Skip to content

Commit b27abe8

Browse files
seifertmTinche
authored andcommitted
refactor: Removed TestUnexistingLoop.remove_loop fixture, because it has no effect.
Under Python 3.10, the remove_loop fixture raises: "DeprecationWarning: There is no current event loop" This means that the remove_loop fixture effectively does nothing. The test case is still kept, because it seemingly aims to test that the "asyncio" marker works inside test classes when no "event_loop" fixture is explicitly specified. Signed-off-by: Michael Seifert <[email protected]>
1 parent e3ec312 commit b27abe8

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

tests/test_simple.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -110,15 +110,8 @@ async def test_asyncio_marker_method(self, event_loop):
110110

111111

112112
class TestUnexistingLoop:
113-
@pytest.fixture
114-
def remove_loop(self):
115-
old_loop = asyncio.get_event_loop()
116-
asyncio.set_event_loop(None)
117-
yield
118-
asyncio.set_event_loop(old_loop)
119-
120113
@pytest.mark.asyncio
121-
async def test_asyncio_marker_without_loop(self, remove_loop):
114+
async def test_asyncio_marker_without_loop(self):
122115
"""Test the asyncio pytest marker in a Test class."""
123116
ret = await async_coro()
124117
assert ret == "ok"

0 commit comments

Comments
 (0)