mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
gh-110722: Make -m test -T -j
use sys.monitoring (GH-111710)
Now all results from worker processes are aggregated and displayed together as a summary at the end of a regrtest run. The traditional trace is left in place for use with sequential in-process test runs but now raises a warning that those numbers are not precise. `-T -j` requires `--with-pydebug` as it relies on `-Xpresite=`.
This commit is contained in:
parent
0b06d2482d
commit
3932b0f7b1
13 changed files with 166 additions and 34 deletions
|
@ -306,13 +306,23 @@ class ParseArgsTestCase(unittest.TestCase):
|
|||
self.assertEqual(ns.use_mp, 2)
|
||||
self.checkError([opt], 'expected one argument')
|
||||
self.checkError([opt, 'foo'], 'invalid int value')
|
||||
self.checkError([opt, '2', '-T'], "don't go together")
|
||||
self.checkError([opt, '0', '-T'], "don't go together")
|
||||
|
||||
def test_coverage(self):
|
||||
def test_coverage_sequential(self):
|
||||
for opt in '-T', '--coverage':
|
||||
with self.subTest(opt=opt):
|
||||
ns = self.parse_args([opt])
|
||||
with support.captured_stderr() as stderr:
|
||||
ns = self.parse_args([opt])
|
||||
self.assertTrue(ns.trace)
|
||||
self.assertIn(
|
||||
"collecting coverage without -j is imprecise",
|
||||
stderr.getvalue(),
|
||||
)
|
||||
|
||||
@unittest.skipUnless(support.Py_DEBUG, 'need a debug build')
|
||||
def test_coverage_mp(self):
|
||||
for opt in '-T', '--coverage':
|
||||
with self.subTest(opt=opt):
|
||||
ns = self.parse_args([opt, '-j1'])
|
||||
self.assertTrue(ns.trace)
|
||||
|
||||
def test_coverdir(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue