Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 37c9a35 commit d2ef66aCopy full SHA for d2ef66a
1 file changed
Lib/test/test_contextlib_async.py
@@ -15,15 +15,12 @@ def _async_test(func):
15
@functools.wraps(func)
16
def wrapper(*args, **kwargs):
17
coro = func(*args, **kwargs)
18
- loop = asyncio.new_event_loop()
19
- asyncio.set_event_loop(loop)
20
- try:
21
- return loop.run_until_complete(coro)
22
- finally:
23
- loop.close()
24
- asyncio.set_event_loop_policy(None)
+ asyncio.run(coro)
25
return wrapper
26
+def tearDownModule():
+ asyncio.set_event_loop_policy(None)
+
27
28
class TestAbstractAsyncContextManager(unittest.TestCase):
29
0 commit comments