@@ -133,7 +133,7 @@ def check(s):
133133 with self .assertRaises (ValueError , msg = 'float(%r)' % (s ,)) as cm :
134134 float (s )
135135 self .assertEqual (str (cm .exception ),
136- 'could not convert string to float: %r' % (s ,))
136+ 'could not convert string to float: %r' % (s ,))
137137
138138 check ('\xbd ' )
139139 check ('123\xbd ' )
@@ -155,7 +155,9 @@ def check(s):
155155 # non-UTF-8 byte string
156156 check (b'123\xa0 ' )
157157
158- @support .run_with_locale ('LC_NUMERIC' , 'fr_FR' , 'de_DE' )
158+ # TODO: RUSTPYTHON
159+ @unittest .skip ("RustPython panics on this" )
160+ @support .run_with_locale ('LC_NUMERIC' , 'fr_FR' , 'de_DE' , '' )
159161 def test_float_with_comma (self ):
160162 # set locale to something that doesn't use '.' for the decimal point
161163 # float must not accept the locale specific decimal point but
@@ -290,11 +292,11 @@ def test_is_integer(self):
290292
291293 def test_floatasratio (self ):
292294 for f , ratio in [
293- (0.875 , (7 , 8 )),
294- (- 0.875 , (- 7 , 8 )),
295- (0.0 , (0 , 1 )),
296- (11.5 , (23 , 2 )),
297- ]:
295+ (0.875 , (7 , 8 )),
296+ (- 0.875 , (- 7 , 8 )),
297+ (0.0 , (0 , 1 )),
298+ (11.5 , (23 , 2 )),
299+ ]:
298300 self .assertEqual (f .as_integer_ratio (), ratio )
299301
300302 for i in range (10000 ):
@@ -337,7 +339,7 @@ def test_float_containment(self):
337339 self .assertTrue ((f ,) == (f ,), "(%r,) != (%r,)" % (f , f ))
338340 self .assertTrue ({f } == {f }, "{%r} != {%r}" % (f , f ))
339341 self .assertTrue ({f : None } == {f : None }, "{%r : None} != "
340- "{%r : None}" % (f , f ))
342+ "{%r : None}" % (f , f ))
341343
342344 # identical containers
343345 l , t , s , d = [f ], (f ,), {f }, {f : None }
@@ -667,8 +669,6 @@ def test_float_specials_do_unpack(self):
667669 ('<f' , LE_FLOAT_NAN )]:
668670 struct .unpack (fmt , data )
669671
670- # TODO: RUSTPYTHON
671- @unittest .expectedFailure
672672 @support .requires_IEEE_754
673673 @unittest .skipIf (_testcapi is None , 'needs _testcapi' )
674674 def test_serialized_float_rounding (self ):
@@ -776,7 +776,7 @@ def test_issue35560(self):
776776class ReprTestCase (unittest .TestCase ):
777777 def test_repr (self ):
778778 with open (os .path .join (os .path .split (__file__ )[0 ],
779- 'floating_points.txt' ), encoding = "utf-8" ) as floats_file :
779+ 'floating_points.txt' ), encoding = "utf-8" ) as floats_file :
780780 for line in floats_file :
781781 line = line .strip ()
782782 if not line or line .startswith ('#' ):
@@ -826,7 +826,7 @@ def test_short_repr(self):
826826 '2.86438000439698e+28' ,
827827 '8.89142905246179e+28' ,
828828 '3.08578087079232e+35' ,
829- ]
829+ ]
830830
831831 for s in test_strings :
832832 negs = '-' + s
@@ -883,7 +883,7 @@ def test_overflow(self):
883883 def test_previous_round_bugs (self ):
884884 # particular cases that have occurred in bug reports
885885 self .assertEqual (round (562949953421312.5 , 1 ),
886- 562949953421312.5 )
886+ 562949953421312.5 )
887887 self .assertEqual (round (56294995342131.5 , 3 ),
888888 56294995342131.5 )
889889 # round-half-even
@@ -1133,7 +1133,7 @@ def test_invalid_inputs(self):
11331133 '0x1.\uff10 p0' ,
11341134 '0x1p0 \n 0x2p0' ,
11351135 '0x1p0\0 0x1p0' , # embedded null byte is not end of string
1136- ]
1136+ ]
11371137 for x in invalid_inputs :
11381138 try :
11391139 result = fromHex (x )
@@ -1152,7 +1152,7 @@ def test_whitespace(self):
11521152 ('1.0' , 1.0 ),
11531153 ('-0x.2' , - 0.125 ),
11541154 ('-0.0' , - 0.0 )
1155- ]
1155+ ]
11561156 whitespace = [
11571157 '' ,
11581158 ' ' ,
@@ -1162,7 +1162,7 @@ def test_whitespace(self):
11621162 '\f ' ,
11631163 '\v ' ,
11641164 '\r '
1165- ]
1165+ ]
11661166 for inp , expected in value_pairs :
11671167 for lead in whitespace :
11681168 for trail in whitespace :
0 commit comments