mirror of
https://github.com/python/cpython
synced 2024-10-14 09:43:55 +00:00
gh-68403: Fix test_coverage in test_trace (GH-108910)
Its behavior no longer affected by test running options such as -m.
This commit is contained in:
parent
1829a3c9a3
commit
7e1a7abb98
|
@ -360,9 +360,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…
Reference in a new issue