summaryrefslogtreecommitdiff
path: root/ext/testlib/test.py
diff options
context:
space:
mode:
Diffstat (limited to 'ext/testlib/test.py')
-rw-r--r--ext/testlib/test.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/testlib/test.py b/ext/testlib/test.py
index 8e2de4946..18899d6d0 100644
--- a/ext/testlib/test.py
+++ b/ext/testlib/test.py
@@ -31,6 +31,21 @@ import functools
import helper
import runner as runner_mod
+class TestingException(Exception):
+ '''Common ancestor for manual Testing Exceptions.'''
+class TestFailException(TestingException):
+ '''Signals that a test has failed.'''
+class TestSkipException(TestingException):
+ '''Signals that a test has been skipped.'''
+
+def fail(message):
+ '''Cause the current test to fail with the given message.'''
+ raise TestFailException(message)
+
+def skip(message):
+ '''Cause the current test to skip with the given message.'''
+ raise TestSkipException(message)
+
class TestCase(object):
'''
Base class for all tests.
@@ -88,4 +103,4 @@ def testfunction(function=None, name=None, fixtures=tuple()):
if function is not None:
return testfunctiondecorator(function)
else:
- return testfunctiondecorator \ No newline at end of file
+ return testfunctiondecorator