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
Merged
Show file tree
Hide file tree
Changes from3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletionLib/test/test_regrtest.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1138,7 +1138,7 @@ def test_coverage(self):
output = self.run_tests("--coverage", test)
self.check_executed_tests(output, [test], stats=1)
regex = (r'lines +cov% +module +\(path\)\n'
r'(?: *[0-9]+ *[0-9]{1,2}% *[^ ]+ +\([^)]+\)+)+')
r'(?: *[0-9]+ *[0-9]{1,2}\.[0-9]% *[^ ]+ +\([^)]+\)+)+')
self.check_line(output, regex)

def test_wait(self):
Expand Down
4 changes: 2 additions & 2 deletionsLib/test/test_trace.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -412,7 +412,7 @@ def test_issue9936(self):
coverage = {}
for line in stdout:
lines, cov, module = line.split()[:3]
coverage[module] = (int(lines),int(cov[:-1]))
coverage[module] = (float(lines),float(cov[:-1]))
# XXX This is needed to run regrtest.py as a script
modname = trace._fullmodname(sys.modules[modname].__file__)
self.assertIn(modname, coverage)
Expand DownExpand Up@@ -553,7 +553,7 @@ def f():
stdout = stdout.decode()
self.assertEqual(status, 0)
self.assertIn('lines cov% module (path)', stdout)
self.assertIn(f'6 100% {modulename} ({filename})', stdout)
self.assertIn(f'6 100.0% {modulename} ({filename})', stdout)

def test_run_as_module(self):
assert_python_ok('-m', 'trace', '-l', '--module', 'timeit', '-n', '1')
Expand Down
2 changes: 1 addition & 1 deletionLib/trace.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -286,7 +286,7 @@ def write_results(self, show_missing=True, summary=False, coverdir=None, *,
print("lines cov% module (path)")
for m in sorted(sums):
n_lines, percent, modulename, filename = sums[m]
print("%5d%3d%%%s (%s)" % sums[m])
print(f"{n_lines:5d}{percent:3.1f}%{modulename} ({filename})")

if self.outfile:
# try and store counts and module info into self.outfile
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
Increase the cov% in module :mod:`trace` to one decimal place.
Loading

[8]ページ先頭

©2009-2025 Movatter.jp