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

Method test_take_refcount

numpy/core/tests/test_regression.py:1586–1598  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1584
1585 @pytest.mark.skipif(not HAS_REFCOUNT, reason="Python lacks refcounts")
1586 def test_take_refcount(self):
1587 # ticket #939
1588 a = np.arange(16, dtype=float)
1589 a.shape = (4, 4)
1590 lut = np.ones((5 + 3, 4), float)
1591 rgba = np.empty(shape=a.shape + (4,), dtype=lut.dtype)
1592 c1 = sys.getrefcount(rgba)
1593 try:
1594 lut.take(a, axis=0, mode='clip', out=rgba)
1595 except TypeError:
1596 pass
1597 c2 = sys.getrefcount(rgba)
1598 assert_equal(c1, c2)
1599
1600 def test_fromfile_tofile_seeks(self):
1601 # On Python 3, tofile/fromfile used to get (#1610) the Python

Callers

nothing calls this directly

Calls 2

assert_equalFunction · 0.90
takeMethod · 0.80

Tested by

no test coverage detected