summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_math.py
diff options
context:
space:
mode:
authorMark Dickinson <dickinsm@gmail.com>2008-04-30 23:30:57 (GMT)
committerMark Dickinson <dickinsm@gmail.com>2008-04-30 23:30:57 (GMT)
commita0de26c3427b63efcd0a678c5d686b4df9f105e4 (patch)
tree359d9467600c47eb14c3a1926e6a9ebda7720bb3 /Lib/test/test_math.py
parent3cbf15f07a72c1dad2196975448ce18725f18c08 (diff)
downloadcpython-a0de26c3427b63efcd0a678c5d686b4df9f105e4.zip
cpython-a0de26c3427b63efcd0a678c5d686b4df9f105e4.tar.gz
cpython-a0de26c3427b63efcd0a678c5d686b4df9f105e4.tar.bz2
Make floating-point exception error messages slightly more verbose: in
particular, the error message now allows one to distinguish between a ValueError arising from a singularity (e.g. log(0.)), which would usually produce +-infinity in non-stop mode, and a ValueError resulting from an invalid input (e.g. sqrt(-1.)), which would normally produce a NaN in non-stop mode.
Diffstat (limited to 'Lib/test/test_math.py')
-rw-r--r--Lib/test/test_math.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_math.py b/Lib/test/test_math.py
index da8a0e9..379ff89 100644
--- a/Lib/test/test_math.py
+++ b/Lib/test/test_math.py
@@ -741,9 +741,9 @@ class MathTests(unittest.TestCase):
func = getattr(math, fn)
try:
result = func(ar)
- except ValueError:
- message = ("Unexpected ValueError in " +
- "test %s:%s(%r)\n" % (id, fn, ar))
+ except ValueError as exc:
+ message = (("Unexpected ValueError: %s\n " +
+ "in test %s:%s(%r)\n") % (exc.args[0], id, fn, ar))
self.fail(message)
self.ftest("%s:%s(%r)" % (id, fn, ar), result, er)