MCPcopy Index your code
hub / github.com/numpy/numpy / _assert_no_warnings_context

Function _assert_no_warnings_context

numpy/testing/_private/utils.py:2070–2077  ·  view source on GitHub ↗
(name=None)

Source from the content-addressed store, hash-verified

2068
2069@contextlib.contextmanager
2070def _assert_no_warnings_context(name=None):
2071 __tracebackhide__ = True # Hide traceback for py.test
2072 with warnings.catch_warnings(record=True) as l:
2073 warnings.simplefilter('always')
2074 yield
2075 if len(l) > 0:
2076 name_str = f' when calling {name}' if name is not None else ''
2077 raise AssertionError(f'Got warnings{name_str}: {l}')
2078
2079
2080def assert_no_warnings(*args, **kwargs):

Callers 1

assert_no_warningsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…