mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
gh-112192: Increase the trace module coverage precision to one decimal (#126972)
This commit is contained in:
parent
dabcecfd6d
commit
12397a5781
4 changed files with 7 additions and 7 deletions
|
@ -412,7 +412,7 @@ class TestCoverage(unittest.TestCase):
|
|||
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)
|
||||
|
@ -553,7 +553,7 @@ class TestCommandLine(unittest.TestCase):
|
|||
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')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue