Skip to content

Commit

Permalink
Replace deprecated get_event_loop with asyncio.run (#4859) (#4860)
Browse files Browse the repository at this point in the history
  • Loading branch information
hramezani committed Dec 21, 2022
1 parent 736a80d commit 6a27124
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/test_decorator.py
Expand Up @@ -266,10 +266,9 @@ async def run():
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'}]


Expand Down

0 comments on commit 6a27124

Please sign in to comment.