Skip to content

Commit 5528c3e

Browse files
committed
chore: Coverage without dynamic context
1 parent 56a1985 commit 5528c3e

1 file changed

Lines changed: 28 additions & 27 deletions

File tree

pyproject.toml

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,34 @@ asyncio_mode = "auto"
6565
markers = ["""slow: marks tests as slow (deselect with '-m "not slow"')"""]
6666
python_files = ["tests.py", "test_*.py", "*_tests.py"]
6767

68+
[tool.coverage.run]
69+
branch = true
70+
# dynamic_context = "test_function"
71+
relative_files = true
72+
data_file = ".coverage"
73+
source = ["statemachine"]
74+
omit = ["*test*.py", "tmp/*", "pytest_cov"]
75+
76+
[tool.coverage.report]
77+
show_missing = true
78+
exclude_lines = [
79+
# Have to re-enable the standard pragma
80+
"pragma: no cover",
81+
82+
# Don't complain about missing debug-only code:
83+
"def __repr__",
84+
"if self.debug",
85+
86+
# Don't complain if tests don't hit defensive assertion code:
87+
"raise AssertionError",
88+
"raise NotImplementedError",
89+
"if TYPE_CHECKING",
90+
]
91+
92+
[tool.coverage.html]
93+
directory = "tmp/htmlcov"
94+
show_contexts = true
95+
6896
[tool.mypy]
6997
python_version = "3.12"
7098
warn_return_any = true
@@ -144,30 +172,3 @@ convention = "google"
144172
[tool.ruff.lint.flake8-pytest-style]
145173
fixture-parentheses = true
146174
mark-parentheses = true
147-
148-
[tool.coverage.run]
149-
branch = true
150-
dynamic_context = "test_function"
151-
relative_files = true
152-
data_file = ".coverage"
153-
source = ["statemachine"]
154-
omit = ["*test*.py", "tmp/*", "pytest_cov"]
155-
[tool.coverage.report]
156-
show_missing = true
157-
exclude_lines = [
158-
# Have to re-enable the standard pragma
159-
"pragma: no cover",
160-
161-
# Don't complain about missing debug-only code:
162-
"def __repr__",
163-
"if self.debug",
164-
165-
# Don't complain if tests don't hit defensive assertion code:
166-
"raise AssertionError",
167-
"raise NotImplementedError",
168-
"if TYPE_CHECKING",
169-
]
170-
171-
[tool.coverage.html]
172-
directory = "tmp/htmlcov"
173-
show_contexts = true

0 commit comments

Comments
 (0)