Skip to content

Commit a10fb9c

Browse files
author
Yalin Li
authored
Use asyncio.run() (Azure#27289)
1 parent d43a37b commit a10fb9c

File tree

1 file changed

+1
-2
lines changed
  • tools/azure-devtools/src/azure_devtools/scenario_tests

1 file changed

+1
-2
lines changed

tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,7 @@ def _preparer_wrapper(test_class_instance, **kwargs):
155155
fn(test_class_instance, **trimmed_kwargs)
156156
else:
157157
if asyncio.iscoroutinefunction(fn):
158-
loop = asyncio.get_event_loop()
159-
loop.run_until_complete(fn(test_class_instance, **trimmed_kwargs))
158+
asyncio.run(fn(test_class_instance, **trimmed_kwargs))
160159
else:
161160
fn(test_class_instance, **trimmed_kwargs)
162161
finally:

0 commit comments

Comments
 (0)