Skip to content

Commit f70b742

Browse files
committed
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 49bae71 commit f70b742

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
@@ -60,6 +60,14 @@ async def reportFailed(self, *args, **kwargs):
6060
raise taskcluster.exceptions.TaskclusterRestFailure("foo", None, status_code=self.status)
6161

6262

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

0 commit comments

Comments
 (0)