Skip to content

Commit 1b3e0c9

Browse files
committed
Django config set explicitly on the coverage tests
1 parent 0581798 commit 1b3e0c9

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

config/settings/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@
2020
},
2121
}
2222

23+
# Disable logging during tests to keep the output clean
24+
# https://docs.djangoproject.com/en/5.2/topics/logging/
25+
for logger in LOGGING["loggers"].values():
26+
logger["handlers"] = ["null"]
27+
logger["level"] = "CRITICAL"
28+
2329

2430
# Ignore whitenoise message about no static directory
2531
warnings.filterwarnings("ignore", message="No directory at", module="whitenoise.base")

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ lines-after-imports = 2
9999
[tool.tox]
100100
# https://tox.wiki/en/latest/config.html#pyproject-toml-native
101101
env_list = ["coverage", "styles", "migrations"]
102-
setenv = { DJANGO_SETTINGS_MODULE = "config.settings.test", DJANGO_SETTINGS_SKIP_LOCAL = "True" }
103102

104103
[tool.tox.env_run_base]
105104
description = "Run the full test suite under {base_python}"
@@ -112,7 +111,7 @@ extras = [
112111
[tool.tox.env.coverage]
113112
description = "Run full unit test suite with coverage"
114113
commands = [
115-
["uv", "run", "coverage", "run", "manage.py", "test"],
114+
["uv", "run", "coverage", "run", "manage.py", "test", "-v2", "--settings", "config.settings.test"],
116115
["uv", "run", "coverage", "html"],
117116
["uv", "run", "coverage", "report", "--show-missing", "--fail-under=100"],
118117
]

0 commit comments

Comments
 (0)