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

Method testInvalidModeStrings

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

Source from the content-addressed store, hash-verified

553 os.unlink(TESTFN)
554
555 def testInvalidModeStrings(self):
556 # check invalid mode strings
557 for mode in ("", "aU", "wU+", "rw", "rt"):
558 try:
559 f = self.FileIO(TESTFN, mode)
560 except ValueError:
561 pass
562 else:
563 f.close()
564 self.fail('%r is an invalid file mode' % mode)
565
566 def testModeStrings(self):
567 # test that the mode attribute is correct for various mode strings

Callers

nothing calls this directly

Calls 2

closeMethod · 0.95
failMethod · 0.45

Tested by

no test coverage detected