Skip to content

Conversation

@danielhollas
Copy link
Collaborator

@danielhollas danielhollas commented Oct 28, 2025

In many tests we use subprocess module to ensure isolation. Collecting code coverage from such tests requires additional coveragepy configuration, see
https://coverage.readthedocs.io/en/7.11.0/config.html#run-patch

This is clearly important, as the coverage is increased by over 2% on this PR.

Follow-up to #7042.

(note: this is partially a fix for a regression from #7042. In earlier versions, the subprocess coverage was handled by pytest-cov plugin, but this support was dropped in the latest 7.0 version, in favour of a (more robust) support directly in coveragepy. See changelog for details: https://pytest-cov.readthedocs.io/en/latest/changelog.html#id1)

@codecov
Copy link

codecov bot commented Oct 28, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.63%. Comparing base (1f2cb47) to head (d73326e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7070      +/-   ##
==========================================
+ Coverage   77.60%   79.63%   +2.03%     
==========================================
  Files         566      566              
  Lines       43498    43498              
==========================================
+ Hits        33754    34635     +881     
+ Misses       9744     8863     -881     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@danielhollas danielhollas changed the title WIP: Better coverage for subprocesses Better code coverage from tests using subprocess Oct 28, 2025
@danielhollas danielhollas marked this pull request as ready for review October 28, 2025 18:13
@danielhollas danielhollas force-pushed the coverage-patch-subprocess branch from fee92cf to d73326e Compare October 28, 2025 23:53
@danielhollas danielhollas requested a review from GeigerJ2 October 28, 2025 23:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant