summaryrefslogtreecommitdiff
path: root/Lib/test
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2013-01-24 07:17:05 -0800
committerEli Bendersky <eliben@gmail.com>2013-01-24 07:17:05 -0800
commit48df2eb9655234c66c7c53701260085ad1ba8044 (patch)
tree41701a31539dff8c4c9aa366d5b94b32bfad9370 /Lib/test
parentaaa9780fe174a4ed5fc19df1d474fb802a19fa42 (diff)
parenteb8c451bd27e64356d848c5e0a0d35b9d70371ca (diff)
downloadcpython-git-48df2eb9655234c66c7c53701260085ad1ba8044.tar.gz
merge heads
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_decimal.py14
1 files changed, 4 insertions, 10 deletions
diff --git a/Lib/test/test_decimal.py b/Lib/test/test_decimal.py
index 37637d6632..69a2fafffb 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