Skip to content

Commit 3d95750

Browse files
authored
Merge pull request #2 from EuroPython/feature/test-cov
added test/cov
2 parents 5a859c6 + 83a35ab commit 3d95750

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Test/Dev
44
DEV_CMD=cd intbot && DJANGO_ENV="dev" uv run --env-file .env -- ./manage.py
5-
TEST_CMD=cd intbot && DJANGO_SETTINGS_MODULE="intbot.settings" DJANGO_ENV="test" uv run pytest --nomigrations
5+
TEST_CMD=DJANGO_SETTINGS_MODULE="intbot.settings" DJANGO_ENV="test" uv run pytest --nomigrations
66
UV_RUN_DEV=cd intbot && DJANGO_ENV="dev" uv run
77

88
# Docker
@@ -61,6 +61,9 @@ test/fast:
6161
# skip slow tests
6262
$(TEST_CMD) -s -v -m "not slow"
6363

64+
test/cov:
65+
$(TEST_CMD) --cov=. --cov-report=term
66+
6467

6568
lint:
6669
# '.' because UV_RUN_DEV implies cd to intbot/

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,25 @@ dependencies = [
2020
"gunicorn>=23.0.0",
2121
"django-stubs>=5.1.1",
2222
"pdbpp>=0.10.3",
23+
"pytest-cov>=6.0.0",
24+
]
25+
26+
[tool.pytest.ini_options]
27+
pythonpath = [
28+
"intbot"
29+
]
30+
31+
[tool.coverage.run]
32+
branch = true
33+
omit = [
34+
"*/migrations/*",
35+
"manage.py",
36+
]
37+
38+
[tool.coverage.report]
39+
show_missing = true
40+
exclude_lines = [
41+
"if 0:",
42+
"def __repr__",
43+
"def __str__",
2344
]

uv.lock

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)