Skip to content

Commit

Permalink
[3.11] gh-111348: Fix direct invocation of test_doctest; remove `te…
Browse files Browse the repository at this point in the history
…st_doctest.test_coverage` (GH-111349) (#111360)

gh-111348: Fix direct invocation of `test_doctest`; remove `test_doctest.test_coverage` (GH-111349)
(cherry picked from commit 31c05b7)

Co-authored-by: Nikita Sobolev <[email protected]>
Co-authored-by: Sergey B Kirpichev <[email protected]>
  • Loading branch information
3 people authored Oct 26, 2023
1 parent 12c7e50 commit 762aba7
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions Lib/test/test_doctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -3318,19 +3318,5 @@ def load_tests(loader, tests, pattern):
return tests


def test_coverage(coverdir):
trace = import_helper.import_module('trace')
tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,],
trace=0, count=1)
tracer.run('test_main()')
r = tracer.results()
print('Writing coverage results...')
r.write_results(show_missing=True, summary=True,
coverdir=coverdir)


if __name__ == '__main__':
if '-c' in sys.argv:
test_coverage('/tmp/doctest.cover')
else:
unittest.main()
unittest.main(module='test.test_doctest')

0 comments on commit 762aba7

Please sign in to comment.