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

Method test_complex_scalar_warning

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

Source from the content-addressed store, hash-verified

1625 f.close()
1626
1627 def test_complex_scalar_warning(self):
1628 for tp in [np.csingle, np.cdouble, np.clongdouble]:
1629 x = tp(1+2j)
1630 assert_warns(np.ComplexWarning, float, x)
1631 with suppress_warnings() as sup:
1632 sup.filter(np.ComplexWarning)
1633 assert_equal(float(x), float(x.real))
1634
1635 def test_complex_scalar_complex_cast(self):
1636 for tp in [np.csingle, np.cdouble, np.clongdouble]:

Callers

nothing calls this directly

Calls 4

assert_warnsFunction · 0.90
suppress_warningsClass · 0.90
assert_equalFunction · 0.90
filterMethod · 0.80

Tested by

no test coverage detected