(self)
| 410 | |
| 411 | @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 'test.tracedmodules.testmod' not found in {} |
| 412 | def test_issue9936(self): |
| 413 | tracer = trace.Trace(trace=0, count=1) |
| 414 | modname = 'test.tracedmodules.testmod' |
| 415 | # Ensure that the module is executed in import |
| 416 | if modname in sys.modules: |
| 417 | del sys.modules[modname] |
| 418 | cmd = ("import test.tracedmodules.testmod as t;" |
| 419 | "t.func(0); t.func2();") |
| 420 | with captured_stdout() as stdout: |
| 421 | self._coverage(tracer, cmd) |
| 422 | stdout.seek(0) |
| 423 | stdout.readline() |
| 424 | coverage = {} |
| 425 | for line in stdout: |
| 426 | lines, cov, module = line.split()[:3] |
| 427 | coverage[module] = (float(lines), float(cov[:-1])) |
| 428 | # XXX This is needed to run regrtest.py as a script |
| 429 | modname = trace._fullmodname(sys.modules[modname].__file__) |
| 430 | self.assertIn(modname, coverage) |
| 431 | self.assertEqual(coverage[modname], (5, 100)) |
| 432 | |
| 433 | def test_coverageresults_update(self): |
| 434 | # Update empty CoverageResults with a non-empty infile. |
nothing calls this directly
no test coverage detected