(fmt, File)
| 10 | |
| 11 | @pytest.mark.parametrize("fmt,File", compr.items()) |
| 12 | def test_files(fmt, File): |
| 13 | if fmt not in compress: |
| 14 | pytest.skip("compression function not provided") |
| 15 | if fmt is None: |
| 16 | return |
| 17 | data = b"1234" * 1000 |
| 18 | compressed = compress[fmt](data) |
| 19 | |
| 20 | b = BytesIO(compressed) |
| 21 | g = File(b, mode="rb") |
| 22 | data2 = g.read() |
| 23 | g.close() |
| 24 | assert data == data2 |