Commit e95dfc50 authored by Stefan Krah's avatar Stefan Krah Committed by GitHub

bpo-33750: Reset thread-local context precision in test_round(). (#7355)

parent 867b8258
......@@ -4454,9 +4454,9 @@ class Coverage(unittest.TestCase):
def test_round(self):
# Python3 behavior: round() returns Decimal
Decimal = self.decimal.Decimal
getcontext = self.decimal.getcontext
localcontext = self.decimal.localcontext
c = getcontext()
with localcontext() as c:
c.prec = 28
self.assertEqual(str(Decimal("9.99").__round__()), "10")
......@@ -5410,7 +5410,7 @@ class CWhitebox(unittest.TestCase):
# SSIZE_MIN
x = (1, (), -sys.maxsize-1)
self.assertEqual(str(c.create_decimal(x)), '-0E-1000026')
self.assertEqual(str(c.create_decimal(x)), '-0E-1000007')
self.assertRaises(InvalidOperation, Decimal, x)
x = (1, (0, 1, 2), -sys.maxsize-1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment