We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5624174 commit 4b981daCopy full SHA for 4b981da
app/services/user_service.py
@@ -19,3 +19,9 @@ async def save_user(user: UserCreate) -> User:
19
async def get_all_users() -> list[User]:
20
log.debug("Reading all users")
21
return _fake_db
22
+
23
+# Clears the in-memory user store.
24
+# Used only in tests to ensure isolation between runs.
25
+def _reset_users():
26
+ global _fake_db
27
+ _fake_db = []
tests/conftest.py
@@ -0,0 +1,7 @@
1
+import pytest
2
+from app.services.user_service import _reset_users
3
4
5
+@pytest.fixture(autouse=True)
6
+def clean_fake_db():
7
+ _reset_users()
0 commit comments