(dtype, with_parens)
| 426 | @pytest.mark.parametrize("dtype", (np.complex64, np.complex128)) |
| 427 | @pytest.mark.parametrize("with_parens", (False, True)) |
| 428 | def test_complex_parsing(dtype, with_parens): |
| 429 | s = "(1.0-2.5j),3.75,(7+-5.0j)\n(4),(-19e2j),(0)" |
| 430 | if not with_parens: |
| 431 | s = s.replace("(", "").replace(")", "") |
| 432 | |
| 433 | res = np.loadtxt(StringIO(s), dtype=dtype, delimiter=",") |
| 434 | expected = np.array( |
| 435 | [[1.0-2.5j, 3.75, 7-5j], [4.0, -1900j, 0]], dtype=dtype |
| 436 | ) |
| 437 | assert_equal(res, expected) |
| 438 | |
| 439 | |
| 440 | def test_read_from_generator(): |
nothing calls this directly
no test coverage detected