aboutsummaryrefslogtreecommitdiffstats
path: root/packages/meshbay-hub/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'packages/meshbay-hub/tests/conftest.py')
-rw-r--r--packages/meshbay-hub/tests/conftest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/packages/meshbay-hub/tests/conftest.py b/packages/meshbay-hub/tests/conftest.py
index ffd6c2e..4593f86 100644
--- a/packages/meshbay-hub/tests/conftest.py
+++ b/packages/meshbay-hub/tests/conftest.py
@@ -70,3 +70,17 @@ async def client(app):
base_url="http://test",
) as c:
yield c
+
+
+@pytest_asyncio.fixture
+async def db_session(app):
+ """
+ A session on the same in-memory database the app is using.
+
+ For assertions that cannot be made through the API — what a deletion left
+ behind, for instance, which is exactly the sort of thing worth checking
+ directly rather than inferring.
+ """
+ from meshbay_hub.db.engine import get_session_factory
+ async with get_session_factory()() as session:
+ yield session