Replace deprecated `get_event_loop` with `asyncio.run`
@@ -271,10 +271,9 @@ def test_async():
v = await foo(1, 2)
assert v == 'a=1 b=2'
- loop = asyncio.get_event_loop_policy().get_event_loop()
- loop.run_until_complete(run())
+ asyncio.run(run())
with pytest.raises(ValidationError) as exc_info:
- loop.run_until_complete(foo('x'))
+ asyncio.run(foo('x'))
assert exc_info.value.errors() == [{'loc': ('b',), 'msg': 'field required', 'type': 'value_error.missing'}]
