xenanetworks / open-automation-core

🚀 XOA framework for test execution, tester management, and data subscription.
https://docs.xenanetworks.com/projects/xoa-core
Apache License 2.0
2 stars 0 forks source link

Can async func be wrapped inside a "normal" func? #27

Open leonardhyu opened 1 year ago

leonardhyu commented 1 year ago

A question from a customer:

In our example script, the function that runs the test is always defined as async def func(...). Is it allowed that this async func is wrapped inside a "normal" function as shown below and then a third-party framework trying to run test_2544() ?

async def do_test_2544():
   ...
   ...

def test_2544():
   asyncio.run(do_test_2544())