8000 removed MsgpackBaseException · sugarguo/msgpack-python@e15085d · GitHub
[go: up one dir, main page]

Skip to content

Commit e15085d

Browse files
committed
removed MsgpackBaseException
1 parent 1183eff commit e15085d

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

msgpack/exceptions.py

Lines changed: 4 additions & 6 deletions
< 8000 th scope="col">Original file line number
Diff line numberDiff line change
@@ -1,8 +1,4 @@
1-
class MsgpackBaseException(Exception):
2-
pass
3-
4-
5-
class UnpackException(MsgpackBaseException):
1+
class UnpackException(Exception):
62
pass
73

84

@@ -26,9 +22,11 @@ def __init__(self, unpacked, extra):
2622
def __str__(self):
2723
return "unpack(b) received extra data."
2824

29-
class PackException(MsgpackBaseException):
25+
26+
class PackException(Exception):
3027
pass
3128

29+
3230
class PackValueError(PackException, ValueError):
3331
pass
3432

test/test_limits.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
import pytest
55

66
from msgpack import packb, unpackb, Packer, Unpacker, ExtType, PackException, PackOverflowError, PackValueError
7-
from msgpack import UnpackValueError, UnpackException, MsgpackBaseException
7+
from msgpack import UnpackValueError, UnpackException
88

99

1010
@pytest.mark.parametrize("expected_exception", [OverflowError, ValueError, PackOverflowError,
11-
PackException, PackValueError, MsgpackBaseException])
11+
PackException, PackValueError])
1212
def test_integer(expected_exception):
1313
x = -(2 ** 63)
1414
assert unpackb(packb(x)) == x
@@ -21,23 +21,23 @@ def test_integer(expected_exception):
2121
packb(x+1)
2222

2323

24-
@pytest.mark.parametrize("expected_exception", [ValueError, PackException, PackValueError, MsgpackBaseException])
24+
@pytest.mark.parametrize("expected_exception", [ValueError, PackException, PackValueError])
2525
def test_array_header(expected_exception):
2626
packer = Packer()
2727
packer.pack_array_header(2**32-1)
2828
with pytest.raises(expected_exception):
2929
packer.pack_array_header(2**32)
3030

3131

32-
@pytest.mark.parametrize("expected_exception", [ValueError, PackException, PackValueError, MsgpackBaseException])
32+
@pytest.mark.parametrize("expected_exception", [ValueError, PackException, PackValueError])
3333
def test_map_header(expected_exception):
3434
packer = Packer()
3535
packer.pack_map_header(2**32-1)
3636
with pytest.raises(expected_exception):
3737
packer.pack_array_header(2**32)
3838

3939

40-
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException, MsgpackBaseException])
40+
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException])
4141
def test_max_str_len(expected_exception):
4242
d = 'x' * 3
4343
packed = packb(d)
@@ -52,7 +52,7 @@ def test_max_str_len(expected_exception):
5252
unpacker.unpack()
5353

5454

55-
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException, MsgpackBaseException])
55+
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException])
5656
def test_max_bin_len(expected_exception):
5757
d = b'x' * 3
5858
packed = packb(d, use_bin_type=True)
@@ -67,7 +67,7 @@ def test_max_bin_len(expected_exception):
6767
unpacker.unpack()
6868

6969

70-
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException, MsgpackBaseException])
70+
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException])
7171
def test_max_array_len(expected_exception):
7272
d = [1,2,3]
7373
packed = packb(d)
@@ -82,7 +82,7 @@ def test_max_array_len(expected_exception):
8282
unpacker.unpack()
8383

8484

85-
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException, MsgpackBaseException])
85+
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException])
8686
def test_max_map_len(expected_exception):
8787
d = {1: 2, 3: 4, 5: 6}
8888
packed = packb(d)
@@ -97,7 +97,7 @@ def test_max_map_len(expected_exception):
9797
unpacker.unpack()
9898

9999

100-
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException, MsgpackBaseException])
100+
@pytest.mark.parametrize("expected_exception", [ValueError, UnpackValueError, UnpackException])
101101
def test_max_ext_len(expected_exception):
102102
d = ExtType(42, b"abc")
103103
packed = packb(d)

0 commit comments

Comments
 (0)
0