From 3ffdfc5607a112a9a2cb933a6af044eaf47e0227 Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Thu, 25 Apr 2024 18:01:28 -0400 Subject: [PATCH] asyncio.run(port_afinalizer()) --- tests/async_fixtures/test_async_fixtures_with_finalizer.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/tests/async_fixtures/test_async_fixtures_with_finalizer.py b/tests/async_fixtures/test_async_fixtures_with_finalizer.py index 3e4ad94e..b4d2ac94 100644 --- a/tests/async_fixtures/test_async_fixtures_with_finalizer.py +++ b/tests/async_fixtures/test_async_fixtures_with_finalizer.py @@ -1,6 +1,5 @@ import asyncio import functools -import warnings import pytest @@ -34,11 +33,7 @@ async def port_afinalizer(): # RuntimeError is raised if task is created on a different loop await finalizer - with warnings.catch_warnings(): - warnings.simplefilter("ignore", DeprecationWarning) - loop = asyncio.get_event_loop() - - loop.run_until_complete(port_afinalizer()) + asyncio.run(port_afinalizer()) worker = asyncio.ensure_future(asyncio.sleep(0.2)) request.addfinalizer(functools.partial(port_finalizer, worker))