From 3661908a6ac75026e4504d9f62a6ac2e2fb2ec5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Wed, 17 Jan 2001 19:11:13 +0000 Subject: This patch removes all uses of "assert" in the regression test suite and replaces them with a new API verify(). As a result the regression suite will also perform its tests in optimization mode. Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum. --- Lib/test/test_support.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'Lib/test/test_support.py') diff --git a/Lib/test/test_support.py b/Lib/test/test_support.py index a24b3ce6b8..8dcec30eba 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 -- cgit v1.2.1