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

Method test_init_close_fp

Lib/test/test_zstd.py:1699–1711  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1697 ZstdFile(io.BytesIO(COMPRESSED_100_PLUS_32KB), zstd_dict=b'dict123456')
1698
1699 def test_init_close_fp(self):
1700 # get a temp file name
1701 with tempfile.NamedTemporaryFile(delete=False) as tmp_f:
1702 tmp_f.write(DAT_130K_C)
1703 filename = tmp_f.name
1704
1705 with self.assertRaises(TypeError):
1706 ZstdFile(filename, options={'a':'b'})
1707
1708 # for PyPy
1709 gc.collect()
1710
1711 os.remove(filename)
1712
1713 def test_close(self):
1714 with io.BytesIO(COMPRESSED_100_PLUS_32KB) as src:

Callers

nothing calls this directly

Calls 5

ZstdFileClass · 0.90
writeMethod · 0.45
assertRaisesMethod · 0.45
collectMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected