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

Method setUpClass

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

Source from the content-addressed store, hash-verified

1809
1810 @classmethod
1811 def setUpClass(cls):
1812 p = cls.ar_with_file = TESTFN + '-with-file.zip'
1813 cls.addClassCleanup(unlink, p)
1814 with zipfile.ZipFile(p, 'w') as zipfp:
1815 zipfp.writestr('test', b'newcontent')
1816
1817 p = cls.ar_with_dir = TESTFN + '-with-dir.zip'
1818 cls.addClassCleanup(unlink, p)
1819 with zipfile.ZipFile(p, 'w') as zipfp:
1820 zipfp.mkdir('test')
1821
1822 p = cls.ar_with_implicit_dir = TESTFN + '-with-implicit-dir.zip'
1823 cls.addClassCleanup(unlink, p)
1824 with zipfile.ZipFile(p, 'w') as zipfp:
1825 zipfp.writestr('test/file', b'newcontent')
1826
1827 def open(self, path):
1828 return zipfile.ZipFile(path, 'r')

Callers 1

setUpClassFunction · 0.45

Calls 3

addClassCleanupMethod · 0.80
writestrMethod · 0.80
mkdirMethod · 0.45

Tested by

no test coverage detected