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

Method test_issue31492

Lib/test/test_import/__init__.py:725–734  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

723
724 @cpython_only
725 def test_issue31492(self):
726 # There shouldn't be an assertion failure in case of failing to import
727 # from a module with a bad __name__ attribute, or in case of failing
728 # to access an attribute of such a module.
729 with swap_attr(os, '__name__', None):
730 with self.assertRaises(ImportError):
731 from os import does_not_exist
732
733 with self.assertRaises(AttributeError):
734 os.does_not_exist
735
736 @threading_helper.requires_working_threading()
737 def test_concurrency(self):

Callers

nothing calls this directly

Calls 2

swap_attrFunction · 0.90
assertRaisesMethod · 0.45

Tested by

no test coverage detected