MCPcopy Create free account
hub / github.com/numpy/numpy / decorator

Function decorator

numpy/testing/_private/utils.py:2391–2404  ·  view source on GitHub ↗
(func)

Source from the content-addressed store, hash-verified

2389 import pytest
2390
2391 def decorator(func):
2392 @wraps(func)
2393 def wrapper(*a, **kw):
2394 msg = check_free_memory(free_bytes)
2395 if msg is not None:
2396 pytest.skip(msg)
2397
2398 try:
2399 return func(*a, **kw)
2400 except MemoryError:
2401 # Probably ran out of memory regardless: don't regard as failure
2402 pytest.xfail("MemoryError raised")
2403
2404 return wrapper
2405
2406 return decorator
2407

Callers 1

decorate_methodsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected