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

Method test_small

numpy/core/tests/test_scalar_methods.py:193–196  ·  view source on GitHub ↗
(self, itype)

Source from the content-addressed store, hash-verified

191
192 @pytest.mark.parametrize("itype", np.sctypes['int']+np.sctypes['uint'])
193 def test_small(self, itype):
194 for a in range(max(np.iinfo(itype).min, 0), 128):
195 msg = f"Smoke test for {itype}({a}).bit_count()"
196 assert itype(a).bit_count() == bin(a).count("1"), msg
197
198 def test_bit_count(self):
199 for exp in [10, 17, 63]:

Callers

nothing calls this directly

Calls 2

maxFunction · 0.50
countMethod · 0.45

Tested by

no test coverage detected