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

Function test_warn_noclose

numpy/core/tests/test_nditer.py:3192–3200  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3190
3191@pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
3192def test_warn_noclose():
3193 a = np.arange(6, dtype='f4')
3194 au = a.byteswap().newbyteorder()
3195 with suppress_warnings() as sup:
3196 sup.record(RuntimeWarning)
3197 it = np.nditer(au, [], [['readwrite', 'updateifcopy']],
3198 casting='equiv', op_dtypes=[np.dtype('f4')])
3199 del it
3200 assert len(sup.log) == 1
3201
3202
3203@pytest.mark.skipif(sys.version_info[:2] == (3, 9) and sys.platform == "win32",

Callers

nothing calls this directly

Calls 4

suppress_warningsClass · 0.90
byteswapMethod · 0.80
recordMethod · 0.80
dtypeMethod · 0.45

Tested by

no test coverage detected