mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 21:29:11 +00:00
Improve DB clean up after test runs
This commit is contained in:
@@ -2,5 +2,6 @@
|
|||||||
DJANGO_SETTINGS_MODULE = khoj.app.settings
|
DJANGO_SETTINGS_MODULE = khoj.app.settings
|
||||||
pythonpath = . src
|
pythonpath = . src
|
||||||
testpaths = tests
|
testpaths = tests
|
||||||
|
addopts = --reuse-db --nomigrations
|
||||||
markers =
|
markers =
|
||||||
chatquality: marks tests as chatquality (deselect with '-m "not chatquality"')
|
chatquality: marks tests as chatquality (deselect with '-m "not chatquality"')
|
||||||
|
|||||||
@@ -50,6 +50,13 @@ def enable_db_access_for_all_tests(db):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.fixture(scope="session", autouse=True)
|
||||||
|
def django_db_setup(django_db_setup, django_db_blocker):
|
||||||
|
"""Ensure proper database setup and teardown for all tests."""
|
||||||
|
with django_db_blocker.unblock():
|
||||||
|
yield
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture(scope="session")
|
@pytest.fixture(scope="session")
|
||||||
def search_config() -> SearchConfig:
|
def search_config() -> SearchConfig:
|
||||||
state.embeddings_model = dict()
|
state.embeddings_model = dict()
|
||||||
|
|||||||
Reference in New Issue
Block a user