| 848 | # via the public interface (although maybe not impossible considering |
| 849 | # the current "DataClass" backing). |
| 850 | class BadFileLike: |
| 851 | counter = 0 |
| 852 | |
| 853 | def read(self, size): |
| 854 | self.counter += 1 |
| 855 | if self.counter > 20: |
| 856 | raise RuntimeError("Bad bad bad!") |
| 857 | return "1,2,3\n" |
| 858 | |
| 859 | with pytest.raises(RuntimeError, match="Bad bad bad!"): |
| 860 | np.core._multiarray_umath._load_from_filelike( |
no outgoing calls