MCPcopy Index your code
hub / github.com/python/cpython / test_coverage

Method test_coverage

Lib/test/test_trace.py:383–392  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

381
382 @requires_resource('cpu')
383 def test_coverage(self):
384 tracer = trace.Trace(trace=0, count=1)
385 with captured_stdout() as stdout:
386 self._coverage(tracer)
387 stdout = stdout.getvalue()
388 self.assertIn("pprint.py", stdout)
389 self.assertIn("case.py", stdout) # from unittest
390 files = os.listdir(TESTFN)
391 self.assertIn("pprint.cover", files)
392 self.assertIn("unittest.case.cover", files)
393
394 def test_coverage_ignore(self):
395 # Ignore all files, nothing should be traced nor printed

Callers

nothing calls this directly

Calls 5

_coverageMethod · 0.95
captured_stdoutFunction · 0.90
assertInMethod · 0.80
listdirMethod · 0.80
getvalueMethod · 0.45

Tested by

no test coverage detected