44import pytest
55
66from 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 ])
1212def 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 ])
2525def 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 ])
3333def 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 ])
4141def 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 ])
5656def 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 ])
7171def 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 ])
8686def 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 ])
101101def test_max_ext_len (expected_exception ):
102102 d = ExtType (42 , b"abc" )
103103 packed = packb (d )
0 commit comments