FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-26818: Add a test to make sure the bug is fixed by berkerpeksag · Pull Request #8664 · python/cpython · GitHub

Repository navigation

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
22 changes: 22 additions & 0 deletions Lib/test/test_trace.py
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
Original file line number Diff line number Diff line change
Expand Up @@ -438,5 +438,27 @@ def test_sys_argv_list(self):
status, trace_stdout, stderr = assert_python_ok('-m', 'trace', '-l', TESTFN)
self.assertIn(direct_stdout.strip(), trace_stdout)

def test_count_and_summary(self):
filename = f'{TESTFN}.py'
coverfilename = f'{TESTFN}.cover'
with open(filename, 'w') as fd:
self.addCleanup(unlink, filename)
self.addCleanup(unlink, coverfilename)
fd.write(textwrap.dedent("""\
x = 1
y = 2

def f():
return x + y

for i in range(10):
f()
"""))
status, stdout, _ = assert_python_ok('-m', 'trace', '-cs', filename)
stdout = stdout.decode()
self.assertEqual(status, 0)
self.assertIn('lines cov% module (path)', stdout)
self.assertIn(f'6 100% {TESTFN} ({filename})', stdout)

if __name__ == '__main__':
unittest.main()

Back | FazBrowse Home | New Git URL