@@ -217,21 +217,21 @@ def test_dragon4(self):
217
217
218
218
available_float_dtypes = [np .float16 , np .float32 , np .float64 , np .float128 ]\
219
219
if hasattr (np , 'float128' ) else [np .float16 , np .float32 , np .float64 ]
220
-
220
+
221
221
@pytest .mark .parametrize ("tp" , available_float_dtypes )
222
222
def test_dragon4_positional_interface (self , tp ):
223
223
# test is flaky for musllinux on np.float128
224
224
if IS_MUSL and tp == np .float128 :
225
225
pytest .skip ("Skipping flaky test of float128 on musllinux" )
226
-
226
+
227
227
fpos = np .format_float_positional
228
-
228
+
229
229
# test padding
230
230
assert_equal (fpos (tp ('1.0' ), pad_left = 4 , pad_right = 4 ), " 1. " )
231
231
assert_equal (fpos (tp ('-1.0' ), pad_left = 4 , pad_right = 4 ), " -1. " )
232
232
assert_equal (fpos (tp ('-10.2' ),
233
233
pad_left = 4 , pad_right = 4 ), " -10.2 " )
234
-
234
+
235
235
# test fixed (non-unique) mode
236
236
assert_equal (fpos (tp ('1.0' ), unique = False , precision = 4 ), "1.0000" )
237
237
@@ -240,7 +240,7 @@ def test_dragon4_positional_interface_trim(self, tp):
240
240
# test is flaky for musllinux on np.float128
241
241
if IS_MUSL and tp == np .float128 :
242
242
pytest .skip ("Skipping flaky test of float128 on musllinux" )
243
-
243
+
244
244
fpos = np .format_float_positional
245
245
# test trimming
246
246
# trim of 'k' or '.' only affects non-unique mode, since unique
@@ -265,26 +265,26 @@ def test_dragon4_positional_interface_trim(self, tp):
265
265
"1.2" if tp != np .float16 else "1.2002" )
266
266
assert_equal (fpos (tp ('1.' ), trim = '-' ), "1" )
267
267
assert_equal (fpos (tp ('1.001' ), precision = 1 , trim = '-' ), "1" )
268
-
268
+
269
269
@pytest .mark .parametrize ("tp" , available_float_dtypes )
270
270
@pytest .mark .parametrize ("pad_val" , [10 ** 5 , np .iinfo ("int32" ).max ])
271
271
def test_dragon4_positional_interface_overflow (self , tp , pad_val ):
272
272
# test is flaky for musllinux on np.float128
273
273
if IS_MUSL and tp == np .float128 :
274
274
pytest .skip ("Skipping flaky test of float128 on musllinux" )
275
-
275
+
276
276
fpos = np .format_float_positional
277
277
278
- #gh-28068
279
- with pytest .raises (RuntimeError ,
278
+ #gh-28068
279
+ with pytest .raises (RuntimeError ,
280
280
match = "Float formatting result too large" ):
281
281
fpos (tp ('1.047' ), unique = False , precision = pad_val )
282
282
283
- with pytest .raises (RuntimeError ,
283
+ with pytest .raises (RuntimeError ,
284
284
match = "Float formatting result too large" ):
285
285
fpos (tp ('1.047' ), precision = 2 , pad_left = pad_val )
286
286
287
- with pytest .raises (RuntimeError ,
287
+ with pytest .raises (RuntimeError ,
288
288
match = "Float formatting result too large" ):
289
289
fpos (tp ('1.047' ), precision = 2 , pad_right = pad_val )
290
290
@@ -293,7 +293,7 @@ def test_dragon4_scientific_interface(self, tp):
293
293
# test is flaky for musllinux on np.float128
294
294
if IS_MUSL and tp == np .float128 :
295
295
pytest .skip ("Skipping flaky test of float128 on musllinux" )
296
-
296
+
297
297
fsci = np .format_float_scientific
298
298
299
299
# test exp_digits
0 commit comments