Use constructor form of "raise"; normalize <wink> docstrings.

This commit is contained in:
Tim Peters 2001-01-19 05:59:21 +00:00
parent d93c0b6a37
commit 983874dd32

View file

@ -15,10 +15,8 @@ class TestSkipped(Error):
example, if some resource can't be used, such as the network example, if some resource can't be used, such as the network
appears to be unavailable, this should be raised instead of appears to be unavailable, this should be raised instead of
TestFailed. TestFailed.
""" """
verbose = 1 # Flag set to 0 by regrtest.py verbose = 1 # Flag set to 0 by regrtest.py
use_large_resources = 1 # Flag set to 0 by regrtest.py use_large_resources = 1 # Flag set to 0 by regrtest.py
@ -73,13 +71,11 @@ def findfile(file, here=__file__):
return file return file
def verify(condition, reason='test failed'): def verify(condition, reason='test failed'):
"""Verify that condition is true. If not, raise an AssertionError.
""" Verify that condition is true. If not, raise an
AssertionError.
The optinal argument reason can be given to provide The optinal argument reason can be given to provide
a better error text. a better error text.
""" """
if not condition: if not condition:
raise AssertionError,reason raise AssertionError(reason)