summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_support.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_support.py')
-rw-r--r--Lib/test/test_support.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py
index a24b3ce..8dcec30 100644
--- a/Lib/test/test_support.py
+++ b/Lib/test/test_support.py
@@ -71,3 +71,15 @@ def findfile(file, here=__file__):
fn = os.path.join(dn, file)
if os.path.exists(fn): return fn
return file
+
+def verify(condition, reason='test failed'):
+
+ """ Verify that condition is true. If not, raise an
+ AssertionError.
+
+ The optinal argument reason can be given to provide
+ a better error text.
+
+ """
+ if not condition:
+ raise AssertionError,reason