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

Function wrapper

Lib/test/test_io/test_largefile.py:174–181  ·  view source on GitHub ↗
(*args, **kwargs)

Source from the content-addressed store, hash-verified

172def skip_no_disk_space(path, required):
173 def decorator(fun):
174 def wrapper(*args, **kwargs):
175 if not hasattr(shutil, "disk_usage"):
176 raise unittest.SkipTest("requires shutil.disk_usage")
177 if shutil.disk_usage(os.path.realpath(path)).free < required:
178 hsize = int(required / 1024 / 1024)
179 raise unittest.SkipTest(
180 f"required {hsize} MiB of free disk space")
181 return fun(*args, **kwargs)
182 return wrapper
183 return decorator
184

Callers

nothing calls this directly

Calls 2

funFunction · 0.50
realpathMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…