Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

core_test_utils.py 371 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  1. import asyncio
  2. def async_test_runner(async_io_co_routine):
  3. """
  4. Used as a decorator to run asynchronous testing
  5. :param async_io_co_routine:
  6. :return: Wrapped function
  7. """
  8. def wrapper(*args, **kwargs):
  9. loop = asyncio.new_event_loop()
  10. return loop.run_until_complete(async_io_co_routine(*args, **kwargs))
  11. return wrapper
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...