| 340 | |
| 341 | def test_file_error_python_exception(): |
| 342 | class BogusFile(io.BytesIO): |
| 343 | def read(self, *args): |
| 344 | raise ZeroDivisionError("zorglub") |
| 345 | |
| 346 | def seek(self, *args): |
| 347 | raise ZeroDivisionError("zorglub") |
| 348 | |
| 349 | # ensure the Python exception is restored |
| 350 | with pytest.raises(ZeroDivisionError, match="zorglub"): |
no outgoing calls