@@ -124,16 +124,20 @@ def test_pack():
124124 assert x == unpack (pack (x )), "Set did not pack/unpack correctly"
125125
126126 x = tuple (range (10 ))
127- assert x == unpack (pack (range (10 ))), "Iterator did not pack/unpack correctly"
127+ assert x == unpack (
128+ pack (range (10 ))), "Iterator did not pack/unpack correctly"
128129
129130 x = Decimal ("1.24" )
130- assert x == approx (unpack (pack (x ))), "Decimal object did not pack/unpack correctly"
131+ assert x == approx (
132+ unpack (pack (x ))), "Decimal object did not pack/unpack correctly"
131133
132134 x = datetime .now ()
133- assert x == unpack (pack (x )), "Datetime object did not pack/unpack correctly"
135+ assert x == unpack (
136+ pack (x )), "Datetime object did not pack/unpack correctly"
134137
135138 x = np .bool_ (True )
136- assert x == unpack (pack (x )), "Numpy bool object did not pack/unpack correctly"
139+ assert x == unpack (
140+ pack (x )), "Numpy bool object did not pack/unpack correctly"
137141
138142 x = "test"
139143 assert x == unpack (pack (x )), "String object did not pack/unpack correctly"
@@ -154,13 +158,15 @@ def test_recarrays():
154158 x = x .view (np .recarray )
155159 assert_array_equal (x , unpack (pack (x )))
156160
157- x = np .array ([(3 , 4 )], dtype = [("tmp0" , float ), ("tmp1" , "O" )]).view (np .recarray )
161+ x = np .array ([(3 , 4 )], dtype = [("tmp0" , float ),
162+ ("tmp1" , "O" )]).view (np .recarray )
158163 assert_array_equal (x , unpack (pack (x )))
159164
160165
161166def test_object_arrays ():
162167 x = np .array (((1 , 2 , 3 ), True ), dtype = "object" )
163- assert_array_equal (x , unpack (pack (x )), "Object array did not serialize correctly" )
168+ assert_array_equal (x , unpack (pack (x )),
169+ "Object array did not serialize correctly" )
164170
165171
166172def test_complex ():
@@ -170,10 +176,12 @@ def test_complex():
170176 z = np .random .randn (10 ) + 1j * np .random .randn (10 )
171177 assert_array_equal (z , unpack (pack (z )), "Arrays do not match!" )
172178
173- x = np .float32 (np .random .randn (3 , 4 , 5 )) + 1j * np .float32 (np .random .randn (3 , 4 , 5 ))
179+ x = np .float32 (np .random .randn (3 , 4 , 5 )) + 1j * \
180+ np .float32 (np .random .randn (3 , 4 , 5 ))
174181 assert_array_equal (x , unpack (pack (x )), "Arrays do not match!" )
175182
176- x = np .int16 (np .random .randn (1 , 2 , 3 )) + 1j * np .int16 (np .random .randn (1 , 2 , 3 ))
183+ x = np .int16 (np .random .randn (1 , 2 , 3 )) + 1j * \
184+ np .int16 (np .random .randn (1 , 2 , 3 ))
177185 assert_array_equal (x , unpack (pack (x )), "Arrays do not match!" )
178186
179187
@@ -185,7 +193,8 @@ def test_insert_longblob(schema_any):
185193
186194 query_mym_blob = {"id" : 1 , "data" : np .array ([1 , 2 , 3 ])}
187195 Longblob .insert1 (query_mym_blob )
188- assert (Longblob & "id=1" ).fetch1 ()["data" ].all () == query_mym_blob ["data" ].all ()
196+ assert_array_equal (
197+ (Longblob & "id=1" ).fetch1 ()["data" ], query_mym_blob ["data" ])
189198 (Longblob & "id=1" ).delete ()
190199
191200
@@ -214,11 +223,14 @@ def test_insert_longblob_32bit(schema_any, enable_feature_32bit_dims):
214223 )
215224 ]
216225 ],
217- dtype = [("hits" , "O" ), ("sides" , "O" ), ("tasks" , "O" ), ("stage" , "O" )],
226+ dtype = [("hits" , "O" ), ("sides" , "O" ),
227+ ("tasks" , "O" ), ("stage" , "O" )],
218228 ),
219229 }
220230 assert fetched ["id" ] == expected ["id" ]
221- assert np .array_equal (fetched ["data" ], expected ["data" ])
231+ for name in expected ['data' ][0 ][0 ].dtype .names :
232+ assert_array_equal (
233+ expected ['data' ][0 ][0 ][name ], fetched ['data' ][0 ][0 ][name ])
222234 (Longblob & "id=1" ).delete ()
223235
224236
0 commit comments