Skip to content

Commit

Permalink
create a new event_loop fixture
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
escapewindow committed Apr 6, 2022
1 parent 49bae71 commit f70b742
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/conftest.py
Expand Up @@ -60,6 +60,14 @@ async def reportFailed(self, *args, **kwargs):
raise taskcluster.exceptions.TaskclusterRestFailure("foo", None, status_code=self.status)


@pytest.fixture(scope="function")
def event_loop(request):
request.param
loop = asyncio.new_event_loop()
yield loop
loop.close()


@pytest.fixture(scope="function")
def successful_queue():
return SuccessfulQueue()
Expand Down

0 comments on commit f70b742

Please sign in to comment.