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

Method test_stacklevel_import

Lib/test/test_warnings/__init__.py:569–577  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

567
568 @unittest.expectedFailure # TODO: RUSTPYTHON; + /Users/al03219714/Projects/RustPython1/crates/pylib/Lib/test/test_warnings/__init__.py
569 def test_stacklevel_import(self):
570 # Issue #24305: With stacklevel=2, module-level warnings should work.
571 import_helper.unload('test.test_warnings.data.import_warning')
572 with warnings_state(self.module):
573 with self.module.catch_warnings(record=True) as w:
574 self.module.simplefilter('always')
575 import test.test_warnings.data.import_warning # noqa: F401
576 self.assertEqual(len(w), 1)
577 self.assertEqual(w[0].filename, __file__)
578
579 def test_skip_file_prefixes(self):
580 with warnings_state(self.module):

Callers

nothing calls this directly

Calls 3

warnings_stateFunction · 0.85
lenFunction · 0.85
assertEqualMethod · 0.45

Tested by

no test coverage detected