Skip to content

Commit 41589d8

Browse files
escapewindowjcristau
authored andcommitted
create a new event_loop fixture
pytest-dev/pytest-asyncio#278 allows for a parametrized event_loop fixture; let's try using this to see if we can avoid a closed event loop error.
1 parent 249038f commit 41589d8

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

tests/conftest.py

+8
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ async def reportFailed(self, *args, **kwargs):
5959
raise taskcluster.exceptions.TaskclusterRestFailure("foo", None, status_code=self.status)
6060

6161

62+
@pytest.fixture(scope="function")
63+
def event_loop(request):
64+
request.param
65+
loop = asyncio.new_event_loop()
66+
yield loop
67+
loop.close()
68+
69+
6270
@pytest.fixture(scope="function")
6371
def successful_queue():
6472
return SuccessfulQueue()

0 commit comments

Comments
 (0)