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

Method test_skip

Lib/test/test_bdb.py:732–755  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

730
731 @patch_list(sys.meta_path)
732 def test_skip(self):
733 # Check that tracing is skipped over the import statement in
734 # 'tfunc_import()'.
735
736 # Remove all but the standard importers.
737 sys.meta_path[:] = (
738 item
739 for item in sys.meta_path
740 if item.__module__.startswith('_frozen_importlib')
741 )
742
743 code = """
744 def main():
745 lno = 3
746 """
747 modules = { TEST_MODULE: code }
748 with create_modules(modules):
749 self.expect_set = [
750 ('line', 2, 'tfunc_import'), ('step', ),
751 ('line', 3, 'tfunc_import'), ('quit', ),
752 ]
753 skip = ('importlib*', 'zipimport', 'encodings.*', TEST_MODULE)
754 with TracerRun(self, skip=skip) as tracer:
755 tracer.runcall(tfunc_import)
756
757 def test_skip_with_no_name_module(self):
758 # some frames have `globals` with no `__name__`

Callers

nothing calls this directly

Calls 4

TracerRunClass · 0.85
create_modulesFunction · 0.70
startswithMethod · 0.45
runcallMethod · 0.45

Tested by

no test coverage detected