Remove pytest warnings

This commit is contained in:
Inada Naoki 2019-01-25 20:52:57 +09:00
parent 28b5f46a34
commit 464fe277e1
3 changed files with 27 additions and 11 deletions

View file

@ -7,7 +7,10 @@ from msgpack import packb, unpackb
def test_unpack_buffer():
from array import array
buf = array('b')
buf.fromstring(packb((b'foo', b'bar')))
try:
buf.frombytes(packb((b'foo', b'bar')))
except AttributeError: # PY2
buf.fromstring(packb((b'foo', b'bar')))
obj = unpackb(buf, use_list=1)
assert [b'foo', b'bar'] == obj