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

Function test_instances

numpy/_core/tests/test_getlimits.py:119–141  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

117
118
119def test_instances():
120 # Test the finfo and iinfo results on numeric instances agree with
121 # the results on the corresponding types
122
123 for c in [int, np.int16, np.int32, np.int64]:
124 class_iinfo = iinfo(c)
125 instance_iinfo = iinfo(c(12))
126
127 assert_iinfo_equal(class_iinfo, instance_iinfo)
128
129 for c in [float, np.float16, np.float32, np.float64]:
130 class_finfo = finfo(c)
131 instance_finfo = finfo(c(1.2))
132 assert_finfo_equal(class_finfo, instance_finfo)
133
134 with pytest.raises(ValueError):
135 iinfo(10.)
136
137 with pytest.raises(ValueError):
138 iinfo('hi')
139
140 with pytest.raises(ValueError):
141 finfo(np.int64(1))
142
143
144def test_subnormal_warning():

Callers

nothing calls this directly

Calls 4

iinfoClass · 0.90
finfoClass · 0.90
assert_iinfo_equalFunction · 0.85
assert_finfo_equalFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…