We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fc3c748 commit 04ddc1bCopy full SHA for 04ddc1b
test/test_buffer.py
@@ -34,12 +34,14 @@ def test_packer_getbuffer():
34
packer.pack_array_header(2)
35
packer.pack(42)
36
packer.pack("hello")
37
- assert bytes(packer) == b"\x92*\xa5hello"
38
buffer = packer.getbuffer()
39
assert isinstance(buffer, memoryview)
40
assert bytes(buffer) == b"\x92*\xa5hello"
41
42
if Packer.__module__ == "msgpack._cmsgpack": # only for Cython
+ # cython Packer supports buffer protocol directly
43
+ assert bytes(packer) == b"\x92*\xa5hello"
44
+
45
with raises(BufferError):
46
47
buffer.release()
0 commit comments