Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-112192: Increase the trace module coverage precision to one decimal#126972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
erlend-aasland merged 8 commits intopython:mainfromrruuaanng:gh112192
Dec 3, 2024

Conversation

@rruuaanng
Copy link
Contributor

@rruuaanngrruuaanng commentedNov 18, 2024
edited by skirpichev
Loading

Before with the current trace module, you'll have a summary output like this:

lines   cov%   module   (path)  154    24%   _weakrefset   (/home/gaogaotiantian/programs/mycpython/Lib/_weakrefset.py) 1293     0%   ast   (/home/gaogaotiantian/programs/mycpython/Lib/ast.py)  160     5%   bz2   (/home/gaogaotiantian/programs/mycpython/Lib/bz2.py)  133    39%   cProfile   (/home/gaogaotiantian/programs/mycpython/Lib/cProfile.py)  903     7%   collections.__init__   (/home/gaogaotiantian/programs/mycpython/Lib/collections/__init__.py)

This patch increase the precision of cov% to one decimal place so you'll have something like:

lines    cov%   module   (path)  154   24.7%   _weakrefset   (/home/gaogaotiantian/programs/mycpython/Lib/_weakrefset.py) 1293    0.2%   ast   (/home/gaogaotiantian/programs/mycpython/Lib/ast.py)  160    5.0%   bz2   (/home/gaogaotiantian/programs/mycpython/Lib/bz2.py)  133   39.8%   cProfile   (/home/gaogaotiantian/programs/mycpython/Lib/cProfile.py)  903    7.8%   collections.__init__   (/home/gaogaotiantian/programs/mycpython/Lib/collections/__init__.py)

So, it makes the impact of small changes visible ;)

This may seem a bit non-sense at the first glance, but it's related to a very practical question - how do we know our coverage improved after some new test cases? With integer percentage, we have a 1% resolution, which means we can't tell if there's a one line improvement if the file is larger than 100 lines. For a file that has 1000 lines, the resolution is 10 lines! It's not trivial!

@rruuaanngrruuaanng marked this pull request as ready for reviewNovember 18, 2024 16:02
Copy link
Contributor

@skirpichevskirpichev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Mostly LGTM, with one comment.

Also, you could change pr description to be more suitable as commit message. Just mention what you do and why it's useful.

@rruuaanng
Copy link
ContributorAuthor

cc@erlend-aasland
For this issue and PR. WDYT? In the discussion, it was specifically mentioned that they hoped to get advice from core developers :)

@skirpichevskirpichev self-requested a reviewNovember 26, 2024 14:34
@erlend-aaslanderlend-aasland changed the titlegh-112192: Increase the cov% of trace to one decimal placegh-112192: Increase the trace module coverage precision to one decimalDec 3, 2024
@erlend-aaslanderlend-aasland merged commit12397a5 intopython:mainDec 3, 2024
42 checks passed
@erlend-aasland
Copy link
Contributor

Thanks for the PR, RUANG; thanks for the review Sergey.

rruuaanng reacted with thumbs up emoji

@rruuaanngrruuaanng deleted the gh112192 branchDecember 4, 2024 03:45
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull requestJan 8, 2025
ebonnal pushed a commit to ebonnal/cpython that referenced this pull requestJan 12, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@skirpichevskirpichevskirpichev approved these changes

@erlend-aaslanderlend-aaslanderlend-aasland approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@rruuaanng@erlend-aasland@skirpichev

[8]ページ先頭

©2009-2025 Movatter.jp