fix: force trace core when dynamic contexts are requested - #757
Draft
aryansk wants to merge 1 commit into
Draft
Conversation
When --cov-context=test is used, force the trace core instead of
sysmon (the default on Python 3.14+) because sysmon does not support
dynamic contexts and coveragepy >= 7.15.3 emits a warning:
Dynamic contexts aren't supported with core=sysmon; context data
may be incomplete (no-sysmon-context)
The _coverage_core property returns 'trace' when cov_context == 'test',
and None otherwise (preserving the default core selection). This is
applied to all three Coverage() constructor call sites (Central,
DistMaster, DistWorker).
Fixes pytest-dev#755
🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
Member
|
Not sure how this is helping but https://agentscan.tools/user/aryansk does not fill me with hope... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #755
When
--cov-context=testis used, force thetracecore instead ofsysmon(the default on Python 3.14+) becausesysmondoes not support dynamic contexts and coveragepy >= 7.15.3 emits a warning:Fix
Added a
_coverage_coreproperty toCovControllerthat returns'trace'whencov_context == 'test', andNoneotherwise (preserving the default core selection). This is applied to all threeCoverage()constructor call sites (Central, DistMaster, DistWorker).Testing
The existing test suite covers the dynamic context functionality. The fix is backward-compatible: when
--cov-contextis not used, no core override is applied.🤖 Generated with Codebuff
Co-Authored-By: Codebuff noreply@codebuff.com