(buf, pickler)
| 382 | |
| 383 | |
| 384 | def check_buffer_pickling(buf, pickler): |
| 385 | # Check that buffer survives a pickle roundtrip |
| 386 | for protocol in range(0, pickler.HIGHEST_PROTOCOL + 1): |
| 387 | result = pickler.loads(pickler.dumps(buf, protocol=protocol)) |
| 388 | assert len(result) == len(buf) |
| 389 | assert memoryview(result) == memoryview(buf) |
| 390 | assert result.to_pybytes() == buf.to_pybytes() |
| 391 | assert result.is_mutable == buf.is_mutable |
| 392 | |
| 393 | |
| 394 | def test_buffer_bytes(pickle_module): |
no test coverage detected