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

Function test_del_attr_handling

numpy/lib/tests/test__datasource.py:337–350  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

335 fp.close()
336
337def test_del_attr_handling():
338 # DataSource __del__ can be called
339 # even if __init__ fails when the
340 # Exception object is caught by the
341 # caller as happens in refguide_check
342 # is_deprecated() function
343
344 ds = datasource.DataSource()
345 # simulate failed __init__ by removing key attribute
346 # produced within __init__ and expected by __del__
347 del ds._istmpdest
348 # should not raise an AttributeError if __del__
349 # gracefully handles failed __init__:
350 ds.__del__()

Callers

nothing calls this directly

Calls 1

__del__Method · 0.95

Tested by

no test coverage detected