MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_init_close_fp

Method test_init_close_fp

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

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected