[cig-commits] r20997 - short/3D/PyLith/branches/v1.8-stable/tests_auto/eqinfo
brad at geodynamics.org
brad at geodynamics.org
Tue Nov 6 22:27:29 PST 2012
Author: brad
Date: 2012-11-06 22:27:29 -0800 (Tue, 06 Nov 2012)
New Revision: 20997
Modified:
short/3D/PyLith/branches/v1.8-stable/tests_auto/eqinfo/TestEqInfo.py
Log:
Fix assert check to be compatible with Python 2.4+.
Modified: short/3D/PyLith/branches/v1.8-stable/tests_auto/eqinfo/TestEqInfo.py
===================================================================
--- short/3D/PyLith/branches/v1.8-stable/tests_auto/eqinfo/TestEqInfo.py 2012-11-07 06:17:25 UTC (rev 20996)
+++ short/3D/PyLith/branches/v1.8-stable/tests_auto/eqinfo/TestEqInfo.py 2012-11-07 06:27:29 UTC (rev 20997)
@@ -32,7 +32,6 @@
"""
Check earthquake stats.
"""
- tol = 1.0e-6
attrs = ["timestamp",
"ruparea",
"potency",
@@ -53,9 +52,9 @@
for (valueE, value) in zip(valuesE, values):
msg = "Mismatch in value for attribute '%s', %g != %g." % (attr, valueE, value)
if valueE != 0.0:
- self.assertAlmostEqual(valueE, value, msg=msg, delta=abs(tol*valueE))
+ self.assertAlmostEqual(1.0, value/valueE, places=6, msg=msg)
else:
- self.assertAlmostEqual(valueE, value, msg=msg, delta=tol)
+ self.assertAlmostEqual(valueE, value, places=6, msg=msg)
return
More information about the CIG-COMMITS
mailing list