(tmpdir)
| 2044 | |
| 2045 | |
| 2046 | def test_input_stream_errors(tmpdir): |
| 2047 | buf = memoryview(b"") |
| 2048 | with pytest.raises(ValueError): |
| 2049 | pa.input_stream(buf, compression="foo") |
| 2050 | |
| 2051 | for arg in [bytearray(), StringIO()]: |
| 2052 | with pytest.raises(TypeError): |
| 2053 | pa.input_stream(arg) |
| 2054 | |
| 2055 | with assert_file_not_found(): |
| 2056 | pa.input_stream("non_existent_file") |
| 2057 | |
| 2058 | with open(str(tmpdir / 'new_file'), 'wb') as f: |
| 2059 | with pytest.raises(TypeError, match="readable file expected"): |
| 2060 | pa.input_stream(f) |
| 2061 | |
| 2062 | |
| 2063 | def test_output_stream_buffer(): |
nothing calls this directly
no test coverage detected