(tmpdir)
| 2229 | |
| 2230 | |
| 2231 | def test_output_stream_errors(tmpdir): |
| 2232 | buf = memoryview(bytearray()) |
| 2233 | with pytest.raises(ValueError): |
| 2234 | pa.output_stream(buf, compression="foo") |
| 2235 | |
| 2236 | for arg in [bytearray(), StringIO()]: |
| 2237 | with pytest.raises(TypeError): |
| 2238 | pa.output_stream(arg) |
| 2239 | |
| 2240 | fn = str(tmpdir / 'new_file') |
| 2241 | with open(fn, 'wb') as f: |
| 2242 | pass |
| 2243 | with open(fn, 'rb') as f: |
| 2244 | with pytest.raises(TypeError, match="writable file expected"): |
| 2245 | pa.output_stream(f) |
nothing calls this directly
no outgoing calls
no test coverage detected