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

Method testBooleanFd

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

Source from the content-addressed store, hash-verified

626 self.assertRaises(OSError, msvcrt.get_osfhandle, make_bad_fd())
627
628 def testBooleanFd(self):
629 for fd in False, True:
630 with self.assertWarnsRegex(RuntimeWarning,
631 'bool is used as a file descriptor') as cm:
632 f = self.FileIO(fd, closefd=False)
633 f.close()
634 self.assertEqual(cm.filename, __file__)
635
636 def testBadModeArgument(self):
637 # verify that we get a sensible error message for bad mode argument

Callers

nothing calls this directly

Calls 3

closeMethod · 0.95
assertWarnsRegexMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected