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

Method test_fileno

Lib/test/test_lzma.py:731–745  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

729 self.assertTrue(f.closed)
730
731 def test_fileno(self):
732 f = LZMAFile(BytesIO(COMPRESSED_XZ))
733 try:
734 self.assertRaises(UnsupportedOperation, f.fileno)
735 finally:
736 f.close()
737 self.assertRaises(ValueError, f.fileno)
738 with TempFile(TESTFN, COMPRESSED_XZ):
739 f = LZMAFile(TESTFN)
740 try:
741 self.assertEqual(f.fileno(), f._fp.fileno())
742 self.assertIsInstance(f.fileno(), int)
743 finally:
744 f.close()
745 self.assertRaises(ValueError, f.fileno)
746
747 def test_seekable(self):
748 f = LZMAFile(BytesIO(COMPRESSED_XZ))

Callers

nothing calls this directly

Calls 9

closeMethod · 0.95
filenoMethod · 0.95
LZMAFileClass · 0.90
BytesIOClass · 0.90
assertIsInstanceMethod · 0.80
TempFileClass · 0.70
assertRaisesMethod · 0.45
assertEqualMethod · 0.45
filenoMethod · 0.45

Tested by

no test coverage detected