MCPcopy Create free account
hub / github.com/tortoise/tortoise-orm / db_search

Function db_search

tests/contrib/postgres/conftest.py:83–98  ·  view source on GitHub ↗

Fixture for TestPostgresSearchLookupTSVector. Uses models defined in tests.contrib.postgres.models_tsvector module. Equivalent to: test.IsolatedTestCase with tortoise_test_modules

()

Source from the content-addressed store, hash-verified

81
82@pytest_asyncio.fixture(scope="function")
83async 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

Callers

nothing calls this directly

Calls 2

tortoise_test_contextFunction · 0.90
skip_if_not_postgresFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…