summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test_read_size.py6
-rw-r--r--test/test_sequnpack.py5
2 files changed, 6 insertions, 5 deletions
diff --git a/test/test_read_size.py b/test/test_read_size.py
index e130805..4e6c2b9 100644
--- a/test/test_read_size.py
+++ b/test/test_read_size.py
@@ -1,5 +1,5 @@
"""Test Unpacker's read_array_header and read_map_header methods"""
-from msgpack import packb, Unpacker
+from msgpack import packb, Unpacker, OutOfData
UnexpectedTypeException = ValueError
def test_read_array_header():
@@ -12,7 +12,7 @@ def test_read_array_header():
try:
unpacker.unpack()
assert 0, 'should raise exception'
- except StopIteration:
+ except OutOfData:
assert 1, 'okay'
@@ -25,7 +25,7 @@ def test_read_map_header():
try:
unpacker.unpack()
assert 0, 'should raise exception'
- except StopIteration:
+ except OutOfData:
assert 1, 'okay'
def test_incorrect_type_array():
diff --git a/test/test_sequnpack.py b/test/test_sequnpack.py
index 769f3ff..f767726 100644
--- a/test/test_sequnpack.py
+++ b/test/test_sequnpack.py
@@ -3,6 +3,7 @@
import six
from msgpack import Unpacker, BufferFull
+from msgpack.exceptions import OutOfData
import nose
def test_foobar():
@@ -17,7 +18,7 @@ def test_foobar():
try:
o = unpacker.unpack()
assert 0, "should raise exception"
- except StopIteration:
+ except OutOfData:
assert 1, "ok"
unpacker.feed(b'foo')
@@ -41,7 +42,7 @@ def test_foobar_skip():
try:
o = unpacker.unpack()
assert 0, "should raise exception"
- except StopIteration:
+ except OutOfData:
assert 1, "ok"
def test_maxbuffersize():