Skip to content

Commit 3ba7abf

Browse files
committed
chore: support pytest-cov and local reporting
Support pytest-cov by disabling include-ignored, allowing pytest-cov to be run, which has built in support for coverage reporting is VS Code making it super useful for checking coverage while writing tests. Related issues: - pytest-dev/pytest-cov#532 - pytest-dev/pytest-cov#369 Without this the coverage run will fail with an error about conflicting coverage options. Configure coverage paths so its easy to run coverage from the command line with the data downloaded from the CI run, enabling easy analysis of the coverage data.
1 parent 78f08f8 commit 3ba7abf

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

pyproject.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,20 @@ omit = [
224224
"pydantic_ai_slim/pydantic_ai/ext/aci.py", # aci-sdk requires Python 3.10+ so cannot be added as an (optional) dependency
225225
]
226226
branch = true
227+
# Disable include-ignored warnings as --source is enabled automatically causing a self conflict as per:
228+
# https://github.com/pytest-dev/pytest-cov/issues/532
229+
# https://github.com/pytest-dev/pytest-cov/issues/369
230+
# This prevents coverage being generated by pytest-cov which has direct editor support in VS Code,
231+
# making it super useful to check coverage while writing tests.
232+
disable_warnings = ["include-ignored"]
233+
234+
[tool.coverage.paths]
235+
# Allow CI run assets to be downloaded an replicated locally.
236+
source = [
237+
".",
238+
"/home/runner/work/pydantic-ai/pydantic-ai",
239+
"/System/Volumes/Data/home/runner/work/pydantic-ai/pydantic-ai"
240+
]
227241

228242
# https://coverage.readthedocs.io/en/latest/config.html#report
229243
[tool.coverage.report]

0 commit comments

Comments
 (0)