Module-scoped fixture for postgres tests using standard testmodels. Creates a TortoiseContext with tests.testmodels once per test module. Used as base for postgres tests that need standard models like TextFields.
()
| 22 | |
| 23 | @pytest_asyncio.fixture(scope="module") |
| 24 | async def db_module_postgres(): |
| 25 | """ |
| 26 | Module-scoped fixture for postgres tests using standard testmodels. |
| 27 | |
| 28 | Creates a TortoiseContext with tests.testmodels once per test module. |
| 29 | Used as base for postgres tests that need standard models like TextFields. |
| 30 | """ |
| 31 | skip_if_not_postgres() |
| 32 | db_url = os.getenv("TORTOISE_TEST_DB", "sqlite://:memory:") |
| 33 | async with tortoise_test_context( |
| 34 | modules=["tests.testmodels"], |
| 35 | db_url=db_url, |
| 36 | app_label="models", |
| 37 | connection_label="models", |
| 38 | ) as ctx: |
| 39 | yield ctx |
| 40 | |
| 41 | |
| 42 | @pytest_asyncio.fixture(scope="function") |
nothing calls this directly
no test coverage detected
searching dependent graphs…