| 1538 | assert_equal(test, control) |
| 1539 | |
| 1540 | def test_file_is_closed_on_error(self): |
| 1541 | # gh-13200 |
| 1542 | with tempdir() as tmpdir: |
| 1543 | fpath = os.path.join(tmpdir, "test.csv") |
| 1544 | with open(fpath, "wb") as f: |
| 1545 | f.write('\N{GREEK PI SYMBOL}'.encode()) |
| 1546 | |
| 1547 | # ResourceWarnings are emitted from a destructor, so won't be |
| 1548 | # detected by regular propagation to errors. |
| 1549 | with assert_no_warnings(): |
| 1550 | with pytest.raises(UnicodeDecodeError): |
| 1551 | np.genfromtxt(fpath, encoding="ascii") |
| 1552 | |
| 1553 | def test_autonames_and_usecols(self): |
| 1554 | # Tests names and usecols |