I have this code:
import pytest
@pytest.fixture
async def my_fixture():
result = 5
yield result
print("Db connection closing or smth yet")
@pytest.mark.asyncio
async def test_my_fixt(my_fixture):
assert my_fixture == 5
If I run this I will have
FAILED tests/t.py::test_my_fixt - assert <async_generator object my_fixture at 0x7fa13415c450> == 5
Is there anything I can do to make my_fixture
return just 5
, not AsyncGenerator
?