mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
[3.11] gh-68403: Fix test_coverage in test_trace (GH-108910) (GH-109105)
Its behavior no longer affected by test running options such as -m.
(cherry picked from commit 7e1a7abb98)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
c2b8d4fe0d
commit
e46be0d2fa
1 changed files with 8 additions and 3 deletions
|
|
@ -362,9 +362,14 @@ def tearDown(self):
|
|||
rmtree(TESTFN)
|
||||
unlink(TESTFN)
|
||||
|
||||
def _coverage(self, tracer,
|
||||
cmd='import test.support, test.test_pprint;'
|
||||
'test.support.run_unittest(test.test_pprint.QueryTestCase)'):
|
||||
DEFAULT_SCRIPT = '''if True:
|
||||
import unittest
|
||||
from test.test_pprint import QueryTestCase
|
||||
loader = unittest.TestLoader()
|
||||
tests = loader.loadTestsFromTestCase(QueryTestCase)
|
||||
tests(unittest.TestResult())
|
||||
'''
|
||||
def _coverage(self, tracer, cmd=DEFAULT_SCRIPT):
|
||||
tracer.run(cmd)
|
||||
r = tracer.results()
|
||||
r.write_results(show_missing=True, summary=True, coverdir=TESTFN)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue