Closed XYCode-Kerman closed 5 months ago
you're using the synchronous test client with an async test framework, and you need to mount your database to your app using lifespan context
fixed here: https://github.com/XYCode-Kerman/AuthPI/pull/1/files
================================================================================ test session starts =================================================================================
platform linux -- Python 3.12.3+, pytest-8.2.1, pluggy-1.5.0
rootdir: /home/graingert/projects/AuthPI
configfile: pyproject.toml
plugins: anyio-4.3.0, cov-5.0.0, asyncio-0.21.2
asyncio: mode=Mode.STRICT
collected 3 items
tests/test_management/test_userpool.py .. [ 66%]
tests/test_utils.py . [100%]
================================================================================= 3 passed in 0.59s ==================================================================================
I don't think this is a bug in pytest-asyncio so I think this issue should be closed
Traceback
Code
All code is fixed on
https://github.com/XYCode-Kerman/AuthPI/tree/feature/test
commit8b071329aae577a0caa30bf29fccf01cd7d6f85f
.Reproduce the error via command
pytest --cov --cov-report=html -v -s --asyncio-mode=auto
.