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

Method test_init_with_x_mode

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

Source from the content-addressed store, hash-verified

1623 pass
1624
1625 def test_init_with_x_mode(self):
1626 with tempfile.NamedTemporaryFile() as tmp_f:
1627 filename = pathlib.Path(tmp_f.name)
1628
1629 for mode in ("x", "xb"):
1630 with ZstdFile(filename, mode):
1631 pass
1632 with self.assertRaises(FileExistsError):
1633 with ZstdFile(filename, mode):
1634 pass
1635 os.remove(filename)
1636
1637 def test_init_bad_mode(self):
1638 with self.assertRaises(ValueError):

Callers

nothing calls this directly

Calls 3

ZstdFileClass · 0.90
assertRaisesMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected