@@ -124,20 +124,16 @@ 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 (
128- pack (range (10 ))), "Iterator did not pack/unpack correctly"
127+ assert x == unpack (pack (range (10 ))), "Iterator did not pack/unpack correctly"
129128
130129 x = Decimal ("1.24" )
131- assert x == approx (
132- unpack (pack (x ))), "Decimal object did not pack/unpack correctly"
130+ assert x == approx (unpack (pack (x ))), "Decimal object did not pack/unpack correctly"
133131
134132 x = datetime .now ()
135- assert x == unpack (
136- pack (x )), "Datetime object did not pack/unpack correctly"
133+ assert x == unpack (pack (x )), "Datetime object did not pack/unpack correctly"
137134
138135 x = np .bool_ (True )
139- assert x == unpack (
140- pack (x )), "Numpy bool object did not pack/unpack correctly"
136+ assert x == unpack (pack (x )), "Numpy bool object did not pack/unpack correctly"
141137
142138 x = "test"
143139 assert x == unpack (pack (x )), "String object did not pack/unpack correctly"
@@ -158,15 +154,13 @@ def test_recarrays():
158154 x = x .view (np .recarray )
159155 assert_array_equal (x , unpack (pack (x )))
160156
161- x = np .array ([(3 , 4 )], dtype = [("tmp0" , float ),
162- ("tmp1" , "O" )]).view (np .recarray )
157+ x = np .array ([(3 , 4 )], dtype = [("tmp0" , float ), ("tmp1" , "O" )]).view (np .recarray )
163158 assert_array_equal (x , unpack (pack (x )))
164159
165160
166161def test_object_arrays ():
167162 x = np .array (((1 , 2 , 3 ), True ), dtype = "object" )
168- assert_array_equal (x , unpack (pack (x )),
169- "Object array did not serialize correctly" )
163+ assert_array_equal (x , unpack (pack (x )), "Object array did not serialize correctly" )
170164
171165
172166def test_complex ():
@@ -176,12 +170,10 @@ def test_complex():
176170 z = np .random .randn (10 ) + 1j * np .random .randn (10 )
177171 assert_array_equal (z , unpack (pack (z )), "Arrays do not match!" )
178172
179- x = np .float32 (np .random .randn (3 , 4 , 5 )) + 1j * \
180- np .float32 (np .random .randn (3 , 4 , 5 ))
173+ x = np .float32 (np .random .randn (3 , 4 , 5 )) + 1j * np .float32 (np .random .randn (3 , 4 , 5 ))
181174 assert_array_equal (x , unpack (pack (x )), "Arrays do not match!" )
182175
183- x = np .int16 (np .random .randn (1 , 2 , 3 )) + 1j * \
184- np .int16 (np .random .randn (1 , 2 , 3 ))
176+ x = np .int16 (np .random .randn (1 , 2 , 3 )) + 1j * np .int16 (np .random .randn (1 , 2 , 3 ))
185177 assert_array_equal (x , unpack (pack (x )), "Arrays do not match!" )
186178
187179
@@ -193,8 +185,7 @@ def test_insert_longblob(schema_any):
193185
194186 query_mym_blob = {"id" : 1 , "data" : np .array ([1 , 2 , 3 ])}
195187 Longblob .insert1 (query_mym_blob )
196- assert_array_equal (
197- (Longblob & "id=1" ).fetch1 ()["data" ], query_mym_blob ["data" ])
188+ assert_array_equal ((Longblob & "id=1" ).fetch1 ()["data" ], query_mym_blob ["data" ])
198189 (Longblob & "id=1" ).delete ()
199190
200191
@@ -223,14 +214,12 @@ def test_insert_longblob_32bit(schema_any, enable_feature_32bit_dims):
223214 )
224215 ]
225216 ],
226- dtype = [("hits" , "O" ), ("sides" , "O" ),
227- ("tasks" , "O" ), ("stage" , "O" )],
217+ dtype = [("hits" , "O" ), ("sides" , "O" ), ("tasks" , "O" ), ("stage" , "O" )],
228218 ),
229219 }
230220 assert fetched ["id" ] == expected ["id" ]
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 ])
221+ for name in expected ["data" ][0 ][0 ].dtype .names :
222+ assert_array_equal (expected ["data" ][0 ][0 ][name ], fetched ["data" ][0 ][0 ][name ])
234223 (Longblob & "id=1" ).delete ()
235224
236225
0 commit comments