-
Notifications
You must be signed in to change notification settings - Fork 95
Expand file tree
/
Copy pathconftest.py
More file actions
30 lines (26 loc) · 1.04 KB
/
conftest.py
File metadata and controls
30 lines (26 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import pytest
def pytest_addoption(parser):
"""These options are used in the search enging backend tests, however they are available to all pytests tests (but unused)"""
parser.addoption(
"--search-engine-backend", action="store", default="utils.search.backends.solr9pysolr.Solr9PySolrSearchEngine"
)
parser.addoption("--write-search-engine-output", action="store_true", default=False)
parser.addoption(
"--keep-solr-index", action="store_true", default=False, help="Keep Solr indexes after tests for inspection"
)
@pytest.fixture
def use_dummy_cache_backend(settings):
settings.CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
},
"api_monitoring": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
},
"clustering": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
},
"cdn_map": {
"BACKEND": "django.core.cache.backends.dummy.DummyCache",
},
}