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

Method test_filename

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

Source from the content-addressed store, hash-verified

530 self.assertEqual(str(w[-1].message), str(UserWarning(ob)))
531
532 def test_filename(self):
533 with warnings_state(self.module):
534 with self.module.catch_warnings(record=True) as w:
535 warning_tests.inner("spam1")
536 self.assertEqual(os.path.basename(w[-1].filename),
537 "stacklevel.py")
538 warning_tests.outer("spam2")
539 self.assertEqual(os.path.basename(w[-1].filename),
540 "stacklevel.py")
541
542 def test_stacklevel(self):
543 # Test stacklevel argument

Callers

nothing calls this directly

Calls 5

warnings_stateFunction · 0.85
basenameMethod · 0.80
innerMethod · 0.45
assertEqualMethod · 0.45
outerMethod · 0.45

Tested by

no test coverage detected