diff options
author | Inada Naoki <songofacandy@gmail.com> | 2019-12-05 20:47:20 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-05 20:47:20 +0900 |
commit | de320488ae494b85a03b60dd33f91b650033d775 (patch) | |
tree | 0a792490e0d1eb04b94a0f818eee138da4205b87 /test | |
parent | 9f4b2d53b77c5ccd96e3ceb359747960cbf03bd4 (diff) | |
download | msgpack-python-de320488ae494b85a03b60dd33f91b650033d775.tar.gz |
fallback: Remove old buffer protocol support (#384)
Diffstat (limited to 'test')
-rw-r--r-- | test/test_buffer.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/test_buffer.py b/test/test_buffer.py index 64fbdef..da68b27 100644 --- a/test/test_buffer.py +++ b/test/test_buffer.py @@ -1,17 +1,17 @@ #!/usr/bin/env python # coding: utf-8 +import sys +import pytest from msgpack import packb, unpackb +@pytest.mark.skipif(sys.version_info[0] == 2, reason="Python 2 is not supported") def test_unpack_buffer(): from array import array buf = array("b") - try: - buf.frombytes(packb((b"foo", b"bar"))) - except AttributeError: # PY2 - buf.fromstring(packb((b"foo", b"bar"))) + buf.frombytes(packb((b"foo", b"bar"))) obj = unpackb(buf, use_list=1) assert [b"foo", b"bar"] == obj |