python-dependency-injector/tests/unit/wiring/test_introspection_py36.py

23 lines
441 B
Python
Raw Permalink Normal View History

"""Tests for compatibility of @inject-patched functions with asyncio and inspect module checks."""
import asyncio
import inspect
from dependency_injector.wiring import inject
def test_asyncio_iscoroutinefunction():
@inject
async def foo():
...
assert asyncio.iscoroutinefunction(foo)
def test_inspect_iscoroutinefunction():
@inject
async def foo():
...
assert inspect.iscoroutinefunction(foo)