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

Method testWarnings

Lib/test/test_io/test_fileio.py:714–720  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

712 self.assertRaises(TypeError, self.FileIO, "1", 0, 0)
713
714 def testWarnings(self):
715 with check_warnings(quiet=True) as w:
716 self.assertEqual(w.warnings, [])
717 self.assertRaises(TypeError, self.FileIO, [])
718 self.assertEqual(w.warnings, [])
719 self.assertRaises(ValueError, self.FileIO, "/some/invalid/name", "rt")
720 self.assertEqual(w.warnings, [])
721
722 def testUnclosedFDOnException(self):
723 class MyException(Exception): pass

Callers

nothing calls this directly

Calls 3

check_warningsFunction · 0.90
assertEqualMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected