4
4
import pytest
5
5
6
6
from msgpack import packb , unpackb , Packer , Unpacker , ExtType , PackException , PackOverflowError , PackValueError
7
- from msgpack import UnpackValueError , UnpackException , MsgpackBaseException
7
+ from msgpack import UnpackValueError , UnpackException
8
8
9
9
10
10
@pytest .mark .parametrize ("expected_exception" , [OverflowError , ValueError , PackOverflowError ,
11
- PackException , PackValueError , MsgpackBaseException ])
11
+ PackException , PackValueError ])
12
12
def test_integer (expected_exception ):
13
13
x = - (2 ** 63 )
14
14
assert unpackb (packb (x )) == x
@@ -21,23 +21,23 @@ def test_integer(expected_exception):
21
21
packb (x + 1 )
22
22
23
23
24
- @pytest .mark .parametrize ("expected_exception" , [ValueError , PackException , PackValueError , MsgpackBaseException ])
24
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , PackException , PackValueError ])
25
25
def test_array_header (expected_exception ):
26
26
packer = Packer ()
27
27
packer .pack_array_header (2 ** 32 - 1 )
28
28
with pytest .raises (expected_exception ):
29
29
packer .pack_array_header (2 ** 32 )
30
30
31
31
32
- @pytest .mark .parametrize ("expected_exception" , [ValueError , PackException , PackValueError , MsgpackBaseException ])
32
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , PackException , PackValueError ])
33
33
def test_map_header (expected_exception ):
34
34
packer = Packer ()
35
35
packer .pack_map_header (2 ** 32 - 1 )
36
36
with pytest .raises (expected_exception ):
37
37
packer .pack_array_header (2 ** 32 )
38
38
39
39
40
- @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException , MsgpackBaseException ])
40
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException ])
41
41
def test_max_str_len (expected_exception ):
42
42
d = 'x' * 3
43
43
packed = packb (d )
@@ -52,7 +52,7 @@ def test_max_str_len(expected_exception):
52
52
unpacker .unpack ()
53
53
54
54
55
- @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException , MsgpackBaseException ])
55
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException ])
56
56
def test_max_bin_len (expected_exception ):
57
57
d = b'x' * 3
58
58
packed = packb (d , use_bin_type = True )
@@ -67,7 +67,7 @@ def test_max_bin_len(expected_exception):
67
67
unpacker .unpack ()
68
68
69
69
70
- @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException , MsgpackBaseException ])
70
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException ])
71
71
def test_max_array_len (expected_exception ):
72
72
d = [1 ,2 ,3 ]
73
73
packed = packb (d )
@@ -82,7 +82,7 @@ def test_max_array_len(expected_exception):
82
82
unpacker .unpack ()
83
83
84
84
85
- @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException , MsgpackBaseException ])
85
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException ])
86
86
def test_max_map_len (expected_exception ):
87
87
d = {1 : 2 , 3 : 4 , 5 : 6 }
88
88
packed = packb (d )
@@ -97,7 +97,7 @@ def test_max_map_len(expected_exception):
97
97
unpacker .unpack ()
98
98
99
99
100
- @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException , MsgpackBaseException ])
100
+ @pytest .mark .parametrize ("expected_exception" , [ValueError , UnpackValueError , UnpackException ])
101
101
def test_max_ext_len (expected_exception ):
102
102
d = ExtType (42 , b"abc" )
103
103
packed = packb (d )
0 commit comments