2525 else partial (json .dumps , encoding = "utf-8" ))
2626
2727
28- class UltraJSONTests (object ):
28+ class TestUltraJSONTests (object ):
2929
3030 @pytest .mark .skipif (compat .is_platform_32bit (),
3131 reason = "not compliant on 32-bit, xref #15865" )
@@ -946,19 +946,19 @@ def my_obj_handler(obj):
946946 ujson .decode (ujson .encode (l , default_handler = str )))
947947
948948
949- class NumpyJSONTests (object ):
949+ class TestNumpyJSONTests (object ):
950950
951- def testBool (self ):
951+ def test_Bool (self ):
952952 b = np .bool (True )
953953 assert ujson .decode (ujson .encode (b )) == b
954954
955- def testBoolArray (self ):
955+ def test_BoolArray (self ):
956956 inpt = np .array ([True , False , True , True , False , True , False , False ],
957957 dtype = np .bool )
958958 outp = np .array (ujson .decode (ujson .encode (inpt )), dtype = np .bool )
959959 tm .assert_numpy_array_equal (inpt , outp )
960960
961- def testInt (self ):
961+ def test_Int (self ):
962962 num = np .int (2562010 )
963963 assert np .int (ujson .decode (ujson .encode (num ))) == num
964964
@@ -986,7 +986,7 @@ def testInt(self):
986986 num = np .uint64 (2562010 )
987987 assert np .uint64 (ujson .decode (ujson .encode (num ))) == num
988988
989- def testIntArray (self ):
989+ def test_IntArray (self ):
990990 arr = np .arange (100 , dtype = np .int )
991991 dtypes = (np .int , np .int8 , np .int16 , np .int32 , np .int64 ,
992992 np .uint , np .uint8 , np .uint16 , np .uint32 , np .uint64 )
@@ -995,7 +995,7 @@ def testIntArray(self):
995995 outp = np .array (ujson .decode (ujson .encode (inpt )), dtype = dtype )
996996 tm .assert_numpy_array_equal (inpt , outp )
997997
998- def testIntMax (self ):
998+ def test_IntMax (self ):
999999 num = np .int (np .iinfo (np .int ).max )
10001000 assert np .int (ujson .decode (ujson .encode (num ))) == num
10011001
@@ -1025,7 +1025,7 @@ def testIntMax(self):
10251025 num = np .uint64 (np .iinfo (np .int64 ).max )
10261026 assert np .uint64 (ujson .decode (ujson .encode (num ))) == num
10271027
1028- def testFloat (self ):
1028+ def test_Float (self ):
10291029 num = np .float (256.2013 )
10301030 assert np .float (ujson .decode (ujson .encode (num ))) == num
10311031
@@ -1035,7 +1035,7 @@ def testFloat(self):
10351035 num = np .float64 (256.2013 )
10361036 assert np .float64 (ujson .decode (ujson .encode (num ))) == num
10371037
1038- def testFloatArray (self ):
1038+ def test_FloatArray (self ):
10391039 arr = np .arange (12.5 , 185.72 , 1.7322 , dtype = np .float )
10401040 dtypes = (np .float , np .float32 , np .float64 )
10411041
@@ -1045,7 +1045,7 @@ def testFloatArray(self):
10451045 inpt , double_precision = 15 )), dtype = dtype )
10461046 tm .assert_almost_equal (inpt , outp )
10471047
1048- def testFloatMax (self ):
1048+ def test_FloatMax (self ):
10491049 num = np .float (np .finfo (np .float ).max / 10 )
10501050 tm .assert_almost_equal (np .float (ujson .decode (
10511051 ujson .encode (num , double_precision = 15 ))), num , 15 )
@@ -1058,7 +1058,7 @@ def testFloatMax(self):
10581058 tm .assert_almost_equal (np .float64 (ujson .decode (
10591059 ujson .encode (num , double_precision = 15 ))), num , 15 )
10601060
1061- def testArrays (self ):
1061+ def test_Arrays (self ):
10621062 arr = np .arange (100 )
10631063
10641064 arr = arr .reshape ((10 , 10 ))
@@ -1099,13 +1099,13 @@ def testArrays(self):
10991099 outp = ujson .decode (ujson .encode (arr ), numpy = True , dtype = np .float32 )
11001100 tm .assert_almost_equal (arr , outp )
11011101
1102- def testOdArray (self ):
1102+ def test_OdArray (self ):
11031103 def will_raise ():
11041104 ujson .encode (np .array (1 ))
11051105
11061106 pytest .raises (TypeError , will_raise )
11071107
1108- def testArrayNumpyExcept (self ):
1108+ def test_ArrayNumpyExcept (self ):
11091109
11101110 input = ujson .dumps ([42 , {}, 'a' ])
11111111 try :
@@ -1188,7 +1188,7 @@ def testArrayNumpyExcept(self):
11881188 except :
11891189 assert False , "Wrong exception"
11901190
1191- def testArrayNumpyLabelled (self ):
1191+ def test_ArrayNumpyLabelled (self ):
11921192 input = {'a' : []}
11931193 output = ujson .loads (ujson .dumps (input ), numpy = True , labelled = True )
11941194 assert (np .empty ((1 , 0 )) == output [0 ]).all ()
@@ -1222,9 +1222,9 @@ def testArrayNumpyLabelled(self):
12221222 assert (np .array (['a' , 'b' ]) == output [2 ]).all ()
12231223
12241224
1225- class PandasJSONTests (object ):
1225+ class TestPandasJSONTests (object ):
12261226
1227- def testDataFrame (self ):
1227+ def test_DataFrame (self ):
12281228 df = DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], index = [
12291229 'a' , 'b' ], columns = ['x' , 'y' , 'z' ])
12301230
@@ -1254,7 +1254,7 @@ def testDataFrame(self):
12541254 tm .assert_index_equal (df .transpose ().columns , outp .columns )
12551255 tm .assert_index_equal (df .transpose ().index , outp .index )
12561256
1257- def testDataFrameNumpy (self ):
1257+ def test_DataFrameNumpy (self ):
12581258 df = DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], index = [
12591259 'a' , 'b' ], columns = ['x' , 'y' , 'z' ])
12601260
@@ -1277,7 +1277,7 @@ def testDataFrameNumpy(self):
12771277 tm .assert_index_equal (df .transpose ().columns , outp .columns )
12781278 tm .assert_index_equal (df .transpose ().index , outp .index )
12791279
1280- def testDataFrameNested (self ):
1280+ def test_DataFrameNested (self ):
12811281 df = DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], index = [
12821282 'a' , 'b' ], columns = ['x' , 'y' , 'z' ])
12831283
@@ -1303,7 +1303,7 @@ def testDataFrameNested(self):
13031303 'df2' : ujson .decode (ujson .encode (df , orient = "split" ))}
13041304 assert ujson .decode (ujson .encode (nested , orient = "split" )) == exp
13051305
1306- def testDataFrameNumpyLabelled (self ):
1306+ def test_DataFrameNumpyLabelled (self ):
13071307 df = DataFrame ([[1 , 2 , 3 ], [4 , 5 , 6 ]], index = [
13081308 'a' , 'b' ], columns = ['x' , 'y' , 'z' ])
13091309
@@ -1326,7 +1326,7 @@ def testDataFrameNumpyLabelled(self):
13261326 tm .assert_index_equal (df .columns , outp .columns )
13271327 tm .assert_index_equal (df .index , outp .index )
13281328
1329- def testSeries (self ):
1329+ def test_Series (self ):
13301330 s = Series ([10 , 20 , 30 , 40 , 50 , 60 ], name = "series" ,
13311331 index = [6 , 7 , 8 , 9 , 10 , 15 ]).sort_values ()
13321332
@@ -1374,7 +1374,7 @@ def testSeries(self):
13741374 s , orient = "index" ), numpy = True )).sort_values ()
13751375 tm .assert_series_equal (outp , exp )
13761376
1377- def testSeriesNested (self ):
1377+ def test_SeriesNested (self ):
13781378 s = Series ([10 , 20 , 30 , 40 , 50 , 60 ], name = "series" ,
13791379 index = [6 , 7 , 8 , 9 , 10 , 15 ]).sort_values ()
13801380
@@ -1400,7 +1400,7 @@ def testSeriesNested(self):
14001400 's2' : ujson .decode (ujson .encode (s , orient = "index" ))}
14011401 assert ujson .decode (ujson .encode (nested , orient = "index" )) == exp
14021402
1403- def testIndex (self ):
1403+ def test_Index (self ):
14041404 i = Index ([23 , 45 , 18 , 98 , 43 , 11 ], name = "index" )
14051405
14061406 # column indexed
0 commit comments