(self)
| 392 | assert_almost_equal(n_r[i], p_r[i], err_msg=f'Loop {i}\n') |
| 393 | |
| 394 | def test_array(self): |
| 395 | x = np.array([1, 1j, 2, 2.5 + .37j, np.inf, np.nan]) |
| 396 | y = np.array([1, 1j, -0.5 + 1.5j, -0.5 + 1.5j, 2, 3]) |
| 397 | lx = list(range(len(x))) |
| 398 | |
| 399 | # Hardcode the expected `builtins.complex` values, |
| 400 | # as complex exponentiation is broken as of bpo-44698 |
| 401 | p_r = [ |
| 402 | 1 + 0j, |
| 403 | 0.20787957635076193 + 0j, |
| 404 | 0.35812203996480685 + 0.6097119028618724j, |
| 405 | 0.12659112128185032 + 0.48847676699581527j, |
| 406 | complex(np.inf, np.nan), |
| 407 | complex(np.nan, np.nan), |
| 408 | ] |
| 409 | |
| 410 | n_r = x ** y |
| 411 | for i in lx: |
| 412 | assert_almost_equal(n_r[i], p_r[i], err_msg=f'Loop {i}\n') |
| 413 | |
| 414 | class TestCabs: |
| 415 | def setup_method(self): |
nothing calls this directly
no test coverage detected