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

Method setUpClass

Lib/test/test_zipfile/test_core.py:1828–1842  ·  view source on GitHub ↗
(cls)

Source from the content-addressed store, hash-verified

1826
1827 @classmethod
1828 def setUpClass(cls):
1829 p = cls.ar_with_file = TESTFN + '-with-file.zip'
1830 cls.addClassCleanup(unlink, p)
1831 with zipfile.ZipFile(p, 'w') as zipfp:
1832 zipfp.writestr('test', b'newcontent')
1833
1834 p = cls.ar_with_dir = TESTFN + '-with-dir.zip'
1835 cls.addClassCleanup(unlink, p)
1836 with zipfile.ZipFile(p, 'w') as zipfp:
1837 zipfp.mkdir('test')
1838
1839 p = cls.ar_with_implicit_dir = TESTFN + '-with-implicit-dir.zip'
1840 cls.addClassCleanup(unlink, p)
1841 with zipfile.ZipFile(p, 'w') as zipfp:
1842 zipfp.writestr('test/file', b'newcontent')
1843
1844 def open(self, path):
1845 return zipfile.ZipFile(path, 'r')

Callers

nothing calls this directly

Calls 3

addClassCleanupMethod · 0.80
writestrMethod · 0.80
mkdirMethod · 0.45

Tested by

no test coverage detected