diff options
author | Eli Bendersky <eliben@gmail.com> | 2013-01-24 15:17:17 (GMT) |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2013-01-24 15:17:17 (GMT) |
commit | fa88b5d656118a3282af06a2104b417237f0786f (patch) | |
tree | b4e14c800e5da051162a8c725bb8de68a663f512 /Lib | |
parent | c4d5e08e3f5463272178ceb226bb7457890e81d3 (diff) | |
parent | 48df2eb9655234c66c7c53701260085ad1ba8044 (diff) | |
download | cpython-fa88b5d656118a3282af06a2104b417237f0786f.zip cpython-fa88b5d656118a3282af06a2104b417237f0786f.tar.gz cpython-fa88b5d656118a3282af06a2104b417237f0786f.tar.bz2 |
merge heads
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_decimal.py | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py index 37637d6..69a2faf 100644 --- a/Lib/test/test_decimal.py +++ b/Lib/test/test_decimal.py @@ -4971,22 +4971,16 @@ class CWhitebox(unittest.TestCase): def test_c_format(self): # Restricted input Decimal = C.Decimal - InvalidOperation = C.InvalidOperation - Rounded = C.Rounded - localcontext = C.localcontext HAVE_CONFIG_64 = (C.MAX_PREC > 425000000) self.assertRaises(TypeError, Decimal(1).__format__, "=10.10", [], 9) self.assertRaises(TypeError, Decimal(1).__format__, "=10.10", 9) self.assertRaises(TypeError, Decimal(1).__format__, []) - with localcontext() as c: - c.traps[InvalidOperation] = True - c.traps[Rounded] = True - self.assertRaises(ValueError, Decimal(1).__format__, "<>=10.10") - maxsize = 2**63-1 if HAVE_CONFIG_64 else 2**31-1 - self.assertRaises(InvalidOperation, Decimal("1.23456789").__format__, - "=%d.1" % maxsize) + self.assertRaises(ValueError, Decimal(1).__format__, "<>=10.10") + maxsize = 2**63-1 if HAVE_CONFIG_64 else 2**31-1 + self.assertRaises(ValueError, Decimal("1.23456789").__format__, + "=%d.1" % maxsize) def test_c_integral(self): Decimal = C.Decimal |