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

Function assert_no_warnings

numpy/testing/_private/utils.py:2080–2111  ·  view source on GitHub ↗

Fail if the given callable produces any warnings. If called with all arguments omitted, may be used as a context manager:: with assert_no_warnings(): do_something() The ability to be used as a context manager is new in NumPy v1.11.0. Parameters ----------

(*args, **kwargs)

Source from the content-addressed store, hash-verified

2078
2079
2080def assert_no_warnings(*args, **kwargs):
2081 """
2082 Fail if the given callable produces any warnings.
2083
2084 If called with all arguments omitted, may be used as a context manager::
2085
2086 with assert_no_warnings():
2087 do_something()
2088
2089 The ability to be used as a context manager is new in NumPy v1.11.0.
2090
2091 Parameters
2092 ----------
2093 func : callable
2094 The callable to test.
2095 \\*args : Arguments
2096 Arguments passed to `func`.
2097 \\*\\*kwargs : Kwargs
2098 Keyword arguments passed to `func`.
2099
2100 Returns
2101 -------
2102 The value returned by `func`.
2103
2104 """
2105 if not args:
2106 return _assert_no_warnings_context()
2107
2108 func = args[0]
2109 args = args[1:]
2110 with _assert_no_warnings_context(name=func.__name__):
2111 return func(*args, **kwargs)
2112
2113
2114def _gen_alignment_data(dtype=float32, type='binary', max_size=24):

Callers 13

test_ragged_shuffleFunction · 0.90
test_safe_castingMethod · 0.90
test_log_valuesMethod · 0.90
test_no_fpeMethod · 0.90
test_warnMethod · 0.90

Calls 2

funcFunction · 0.50

Tested by 13

test_ragged_shuffleFunction · 0.72
test_safe_castingMethod · 0.72
test_log_valuesMethod · 0.72
test_no_fpeMethod · 0.72
test_warnMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…