File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -3187,7 +3187,8 @@ def test_compact_ints(self):
3187
3187
3188
3188
def test_precise_conversion (self ):
3189
3189
# GH #8002
3190
- from decimal import Decimal
3190
+ from decimal import Decimal , getcontext
3191
+ getcontext ().prec = 100
3191
3192
normal_errors = []
3192
3193
precise_errors = []
3193
3194
for num in np .linspace (1. , 2. , num = 500 ): # test numbers between 1 and 2
@@ -3201,8 +3202,8 @@ def error(val):
3201
3202
normal_errors .append (error (normal_val ))
3202
3203
precise_errors .append (error (precise_val ))
3203
3204
self .assertEqual (roundtrip_val , float (text [2 :])) # round-trip should match float()
3204
- self .assertTrue (sum (precise_errors ) < sum (normal_errors ))
3205
- self .assertTrue (max (precise_errors ) < max (normal_errors ))
3205
+ self .assertTrue (sum (precise_errors ) <= sum (normal_errors ))
3206
+ self .assertTrue (max (precise_errors ) <= max (normal_errors ))
3206
3207
3207
3208
def test_pass_dtype (self ):
3208
3209
data = """\
You can’t perform that action at this time.
0 commit comments