MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / db_array_fields

Function db_array_fields

tests/fields/conftest.py:17–34  ·  view source on GitHub ↗

Fixture for TestArrayFields. Uses models defined in tests.testmodels_postgres module. Equivalent to: test.IsolatedTestCase with tortoise_test_modules=["tests.testmodels_postgres"]

()

Source from the content-addressed store, hash-verified

15
16@pytest_asyncio.fixture(scope="function")
17async def db_array_fields():
18 """
19 Fixture for TestArrayFields.
20
21 Uses models defined in tests.testmodels_postgres module.
22 Equivalent to: test.IsolatedTestCase with tortoise_test_modules=["tests.testmodels_postgres"]
23 """
24 db_url = os.getenv("TORTOISE_TEST_DB", "sqlite://:memory:")
25 # Skip on non-Postgres databases since ArrayFields require Postgres
26 if "postgres" not in db_url:
27 pytest.skip("ArrayFields require PostgreSQL")
28 async with tortoise_test_context(
29 modules=["tests.testmodels_postgres"],
30 db_url=db_url,
31 app_label="models",
32 connection_label="models",
33 ) as ctx:
34 yield ctx
35
36
37@pytest_asyncio.fixture(scope="function")

Callers

nothing calls this directly

Calls 1

tortoise_test_contextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…