Fixture for TestPostgresSearchLookupTSVector. Uses models defined in tests.contrib.postgres.models_tsvector module. Equivalent to: test.IsolatedTestCase with tortoise_test_modules
()
| 81 | |
| 82 | @pytest_asyncio.fixture(scope="function") |
| 83 | async def db_search(): |
| 84 | """ |
| 85 | Fixture for TestPostgresSearchLookupTSVector. |
| 86 | |
| 87 | Uses models defined in tests.contrib.postgres.models_tsvector module. |
| 88 | Equivalent to: test.IsolatedTestCase with tortoise_test_modules |
| 89 | """ |
| 90 | skip_if_not_postgres() |
| 91 | db_url = os.getenv("TORTOISE_TEST_DB", "sqlite://:memory:") |
| 92 | async with tortoise_test_context( |
| 93 | modules=["tests.contrib.postgres.models_tsvector"], |
| 94 | db_url=db_url, |
| 95 | app_label="models", |
| 96 | connection_label="models", |
| 97 | ) as ctx: |
| 98 | yield ctx |
nothing calls this directly
no test coverage detected
searching dependent graphs…