Skip to content

Commit 04ddc1b

Browse files
committedMay 5, 2024
fix test
1 parent fc3c748 commit 04ddc1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎test/test_buffer.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,14 @@ def test_packer_getbuffer():
3434
packer.pack_array_header(2)
3535
packer.pack(42)
3636
packer.pack("hello")
37-
assert bytes(packer) == b"\x92*\xa5hello"
3837
buffer = packer.getbuffer()
3938
assert isinstance(buffer, memoryview)
4039
assert bytes(buffer) == b"\x92*\xa5hello"
4140

4241
if Packer.__module__ == "msgpack._cmsgpack": # only for Cython
42+
# cython Packer supports buffer protocol directly
43+
assert bytes(packer) == b"\x92*\xa5hello"
44+
4345
with raises(BufferError):
4446
packer.pack(42)
4547
buffer.release()

0 commit comments

Comments
 (0)