sqlakit 0.8.0__tar.gz → 0.8.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sqlakit-0.8.0 → sqlakit-0.8.1}/PKG-INFO +1 -1
- {sqlakit-0.8.0 → sqlakit-0.8.1}/pyproject.toml +1 -1
- {sqlakit-0.8.0 → sqlakit-0.8.1}/pyproject.toml.orig +1 -1
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/pytest_plugin.py +17 -1
- {sqlakit-0.8.0 → sqlakit-0.8.1}/LICENSE +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/README.md +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/__init__.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_base.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_db.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_discovery.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_model.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_query.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_recording.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_registry.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_routing.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/_sql.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/asyncio/__init__.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/asyncio/_db.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/asyncio/_registry.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/asyncio/orm.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/asyncio/sql.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/exceptions.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/orm.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/py.typed +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/sql.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/testing.py +0 -0
- {sqlakit-0.8.0 → sqlakit-0.8.1}/sqlakit/types.py +0 -0
|
@@ -85,7 +85,23 @@ def pytest_collection_modifyitems(
|
|
|
85
85
|
if item.get_closest_marker(MARKER) is None:
|
|
86
86
|
continue
|
|
87
87
|
awaited = inspect.iscoroutinefunction(item.function)
|
|
88
|
-
|
|
88
|
+
name = ASYNC_FIXTURE if awaited else SYNC_FIXTURE
|
|
89
|
+
item.fixturenames.insert(_before_the_test_s_own(item), name)
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def _before_the_test_s_own(item: pytest.Function) -> int:
|
|
93
|
+
"""Return where the transaction goes among the fixtures of a test.
|
|
94
|
+
|
|
95
|
+
`fixturenames` is the order they set up in. A fixture of the test's own
|
|
96
|
+
that writes has to run inside the transaction, and one of a wider scope,
|
|
97
|
+
the schema or a module that seeds itself, has to run outside it.
|
|
98
|
+
"""
|
|
99
|
+
known = item._fixtureinfo.name2fixturedefs # noqa: SLF001
|
|
100
|
+
for index, name in enumerate(item.fixturenames):
|
|
101
|
+
defined = known.get(name)
|
|
102
|
+
if defined and defined[-1].scope == "function":
|
|
103
|
+
return index
|
|
104
|
+
return len(item.fixturenames)
|
|
89
105
|
|
|
90
106
|
|
|
91
107
|
@pytest.fixture(scope="session")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|