MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_coverage_ignore

Method test_coverage_ignore

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

Source from the content-addressed store, hash-verified

397 self.assertIn("unittest.case.cover", files)
398
399 def test_coverage_ignore(self):
400 # Ignore all files, nothing should be traced nor printed
401 libpath = os.path.normpath(os.path.dirname(os.path.dirname(__file__)))
402 # sys.prefix does not work when running from a checkout
403 tracer = trace.Trace(ignoredirs=[sys.base_prefix, sys.base_exec_prefix,
404 libpath] + sys.path, trace=0, count=1)
405 with captured_stdout() as stdout:
406 self._coverage(tracer)
407 if os.path.exists(TESTFN):
408 files = os.listdir(TESTFN)
409 self.assertEqual(files, ['_importlib.cover']) # Ignore __import__
410
411 @unittest.expectedFailure # TODO: RUSTPYTHON; AssertionError: 'test.tracedmodules.testmod' not found in {}
412 def test_issue9936(self):

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected