mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-24 02:24:02 +03:00
23 lines
441 B
Python
23 lines
441 B
Python
|
"""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)
|