forked from loafle/openapi-generator-original
[python-pydantic-v1] various improvements (#16658)
* rename, add tests * remove library support in python pydantic v1 codegen * copy tests * copy echo api tests * update samples * update doc * add back library support
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
# flake8: noqa
|
||||
|
||||
import asyncio
|
||||
import random
|
||||
|
||||
|
||||
def id_gen(bits=32):
|
||||
""" Returns a n-bit randomly generated int """
|
||||
return int(random.getrandbits(bits))
|
||||
|
||||
|
||||
def async_test(f):
|
||||
def wrapper(*args, **kwargs):
|
||||
# coro = asyncio.coroutine(f)
|
||||
coro = f
|
||||
future = coro(*args, **kwargs)
|
||||
loop = asyncio.get_event_loop()
|
||||
loop.run_until_complete(future)
|
||||
return wrapper
|
||||
Reference in New Issue
Block a user