summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_cmath.py
diff options
context:
space:
mode:
authorRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1996-12-20 22:36:52 (GMT)
committerRoger E. Masse <rmasse@newcnri.cnri.reston.va.us>1996-12-20 22:36:52 (GMT)
commitfab8ab80674375b945e93792701c672af98da067 (patch)
treec9cf051ed834a35c4805d3303bfe0ed3fa39d101 /Lib/test/test_cmath.py
parent4b722788ae2bbd5595aef38f4fd7221a3ab88372 (diff)
downloadcpython-fab8ab80674375b945e93792701c672af98da067.zip
cpython-fab8ab80674375b945e93792701c672af98da067.tar.gz
cpython-fab8ab80674375b945e93792701c672af98da067.tar.bz2
Many scripts, but small changes. Update the way the scripts obtain the
'verbose' flag ala GvR updated test harness architecture. Old way: verbose = 0 if __name__ == '__main__': verbose = 1 New way: from test_support import verbose Some other small readablility and functionality updates.
Diffstat (limited to 'Lib/test/test_cmath.py')
-rwxr-xr-xLib/test/test_cmath.py45
1 files changed, 29 insertions, 16 deletions
diff --git a/Lib/test/test_cmath.py b/Lib/test/test_cmath.py
index 8c452d7..d7b1b88 100755
--- a/Lib/test/test_cmath.py
+++ b/Lib/test/test_cmath.py
@@ -3,20 +3,33 @@
Roger E. Masse
"""
import cmath
+from test_support import verbose
-cmath.acos(1.0)
-cmath.acosh(1.0)
-cmath.asin(1.0)
-cmath.asinh(1.0)
-cmath.atan(0.2)
-cmath.atanh(0.3)
-cmath.cos(1.0)
-cmath.cosh(1.0)
-cmath.exp(1.0)
-cmath.log(1.0)
-cmath.log10(1.0)
-cmath.sin(1.0)
-cmath.sinh(1.0)
-cmath.sqrt(1.0)
-cmath.tan(1.0)
-cmath.tanh(1.0)
+testdict = {'acos' : 1.0,
+ 'acosh' : 1.0,
+ 'asin' : 1.0,
+ 'asinh' : 1.0,
+ 'atan' : 0.2,
+ 'atanh' : 0.2,
+ 'cos' : 1.0,
+ 'cosh' : 1.0,
+ 'exp' : 1.0,
+ 'log' : 1.0,
+ 'log10' : 1.0,
+ 'sin' : 1.0,
+ 'sinh' : 1.0,
+ 'sqrt' : 1.0,
+ 'tan' : 1.0,
+ 'tanh' : 1.0}
+
+for func in testdict.keys():
+ f = getattr(cmath, func)
+ r = f(testdict[func])
+ if verbose:
+ print 'Calling %s(%f) = %f' % (func, testdict[func], abs(r))
+
+p = cmath.pi
+e = cmath.e
+if verbose:
+ print 'PI = ', abs(p)
+ print 'E = ', abs(e)