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

Method test_coverage_ignore

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

Source from the content-addressed store, hash-verified

392 self.assertIn("unittest.case.cover", files)
393
394 def test_coverage_ignore(self):
395 # Ignore all files, nothing should be traced nor printed
396 libpath = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
397 # sys.prefix does not work when running from a checkout
398 tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,
399 libpath] + sys.path, trace=0, count=1)
400 with captured_stdout() as stdout:
401 self._coverage(tracer)
402 if os.path.exists(TESTFN):
403 files = os.listdir(TESTFN)
404 self.assertEqual(files, ['_importlib.cover']) # Ignore __import__
405
406 def test_issue9936(self):
407 tracer = trace.Trace(trace=0, count=1)

Callers

nothing calls this directly

Calls 6

_coverageMethod · 0.95
captured_stdoutFunction · 0.90
listdirMethod · 0.80
dirnameMethod · 0.45
existsMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected