Skip to content

Fix: Exclude platform-specific code from coverage, fixes #9351#9352

Open
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
trxvorr:fix-coverage-config
Open

Fix: Exclude platform-specific code from coverage, fixes #9351#9352
trxvorr wants to merge 1 commit intoborgbackup:masterfrom
trxvorr:fix-coverage-config

Conversation

@trxvorr
Copy link
Contributor

@trxvorr trxvorr commented Feb 15, 2026

Description

This PR addresses missing coverage reports for platform-specific code (e.g., # pragma: win32 only) by explicitly excluding these pragmas in pyproject.toml. Fixes #9351.

Previously, pyproject.toml only excluded pragma: freebsd only and pragma: unknown platform only. This caused Codecov to report missing coverage for valid platform-specific imports (like set_birthtime on Windows) when running on Linux CI.

Changes

  • pyproject.toml: Added win32, posix, linux, darwin, and netbsd pragmas to the exclude_lines list in coverage configuration.

Verification

  • Verify that Codecov no longer reports missing coverage for lines marked with these pragmas.

@codecov
Copy link

codecov bot commented Feb 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 76.20%. Comparing base (3349cdc) to head (2c25719).
⚠️ Report is 1 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9352      +/-   ##
==========================================
+ Coverage   76.03%   76.20%   +0.17%     
==========================================
  Files          85       85              
  Lines       14744    14699      -45     
  Branches     2194     2191       -3     
==========================================
- Hits        11211    11202       -9     
+ Misses       2856     2820      -36     
  Partials      677      677              

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

@trxvorr trxvorr changed the title Fix: Exclude platform-specific code from coverage Fix: Exclude platform-specific code from coverage, fixes #9351 Feb 15, 2026
@ThomasWaldmann
Copy link
Member

Is that the only way to deal with it, by completely excluding these lines everywhere?

Actually we have coverage for platform-specific lines, but only on the runner with the respective platform.

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.

Missing coverage reports for platform-specific code

2 participants