mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-02-28 17:50:35 +03:00
Co-authored-by: Martin Lafrance <mlafrance@cae.com> Co-authored-by: ZipFile <zipfile.d@protonmail.com>
30 lines
533 B
Python
30 lines
533 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_isfunction():
|
|
@inject
|
|
def foo(): ...
|
|
|
|
assert inspect.isfunction(foo)
|
|
|
|
|
|
def test_asyncio_iscoroutinefunction():
|
|
@inject
|
|
async def foo():
|
|
...
|
|
|
|
assert asyncio.iscoroutinefunction(foo)
|
|
|
|
|
|
def test_inspect_iscoroutinefunction():
|
|
@inject
|
|
async def foo():
|
|
...
|
|
|
|
assert inspect.iscoroutinefunction(foo)
|