MCPcopy Create free account
hub / github.com/python/cpython / test_filename

Method test_filename

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

Source from the content-addressed store, hash-verified

583 self.assertEqual(str(w[-1].message), str(UserWarning(ob)))
584
585 def test_filename(self):
586 with warnings_state(self.module):
587 with self.module.catch_warnings(record=True) as w:
588 warning_tests.inner("spam1")
589 self.assertEqual(os.path.basename(w[-1].filename),
590 "stacklevel.py")
591 warning_tests.outer("spam2")
592 self.assertEqual(os.path.basename(w[-1].filename),
593 "stacklevel.py")
594
595 def test_stacklevel(self):
596 # Test stacklevel argument

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected