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

Method _make_test_file

Lib/test/test_mmap.py:899–914  ·  view source on GitHub ↗
(self, num_zeroes, tail)

Source from the content-addressed store, hash-verified

897 unlink(TESTFN)
898
899 def _make_test_file(self, num_zeroes, tail):
900 if sys.platform[:3] == 'win' or sys.platform == 'darwin':
901 requires('largefile',
902 'test requires %s bytes and a long time to run' % str(0x180000000))
903 f = open(TESTFN, 'w+b')
904 try:
905 f.seek(num_zeroes)
906 f.write(tail)
907 f.flush()
908 except (OSError, OverflowError, ValueError):
909 try:
910 f.close()
911 except (OSError, OverflowError):
912 pass
913 raise unittest.SkipTest("filesystem does not have largefile support")
914 return f
915
916 def test_large_offset(self):
917 with self._make_test_file(0x14FFFFFFF, b" ") as f:

Callers 3

test_large_offsetMethod · 0.95
test_large_filesizeMethod · 0.95
_test_around_boundaryMethod · 0.95

Calls 7

requiresFunction · 0.90
strFunction · 0.85
openFunction · 0.50
seekMethod · 0.45
writeMethod · 0.45
flushMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected