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

Function db_subclass_fields

tests/fields/conftest.py:38–52  ·  view source on GitHub ↗

Fixture for TestEnumField and TestCustomFieldFilters. Uses models defined in tests.fields.subclass_models module. Equivalent to: test.IsolatedTestCase with tortoise_test_modules=["tests.fields.subclass_models"]

()

Source from the content-addressed store, hash-verified

36
37@pytest_asyncio.fixture(scope="function")
38async def db_subclass_fields():
39 """
40 Fixture for TestEnumField and TestCustomFieldFilters.
41
42 Uses models defined in tests.fields.subclass_models module.
43 Equivalent to: test.IsolatedTestCase with tortoise_test_modules=["tests.fields.subclass_models"]
44 """
45 db_url = os.getenv("TORTOISE_TEST_DB", "sqlite://:memory:")
46 async with tortoise_test_context(
47 modules=["tests.fields.subclass_models"],
48 db_url=db_url,
49 app_label="models",
50 connection_label="models",
51 ) as ctx:
52 yield ctx

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…