compat.doctest.DocFileCase API [rev. 38799]

class DocFileCase(compat.doctest.DocTestCase):

*no docstring available*

methods:

def __init__(self, test, optionflags=0, setUp=None, tearDown=None, checker=None):

*no docstring available*

def failUnlessAlmostEqual(self, first, second, places=7, msg=None):

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).

def failUnlessAlmostEqual(self, first, second, places=7, msg=None):

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).

def failUnlessEqual(self, first, second, msg=None):

Fail if the two objects are unequal as determined by the '==' operator.

def failUnlessEqual(self, first, second, msg=None):

Fail if the two objects are unequal as determined by the '==' operator.

def failIf(self, expr, msg=None):

Fail the test if the expression is true.

def failIfAlmostEqual(self, first, second, places=7, msg=None):

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).

def failIfAlmostEqual(self, first, second, places=7, msg=None):

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).

def failIfEqual(self, first, second, msg=None):

Fail if the two objects are equal as determined by the '==' operator.

def failIfEqual(self, first, second, msg=None):

Fail if the two objects are equal as determined by the '==' operator.

def failUnlessRaises(self, excClass, callableObj, *args, **kwargs):

Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.

def failUnless(self, expr, msg=None):

Fail the test unless the expression is true.

def failUnless(self, expr, msg=None):

Fail the test unless the expression is true.

def countTestCases(self):

*no docstring available*

def debug(self):

Run the test case without results and without catching exceptions The unit test framework includes a debug method on test cases and test suites to support post-mortem debugging. The test code is run in such a way that errors are not caught. This way a caller can catch the errors and initiate post-mortem debugging. The DocTestCase provides a debug method that raises UnexpectedException errors if there is an unexepcted exception: >>> test = DocTestParser().get_doctest('>>> raise KeyError\n42', ... {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except UnexpectedException, failure: ... pass The UnexpectedException contains the test, the example, and the original exception: >>> failure.test is test True >>> failure.example.want '42\n' >>> exc_info = failure.exc_info >>> raise exc_info[0], exc_info[1], exc_info[2] Traceback (most recent call last): ... KeyError If the output doesn't match, then a DocTestFailure is raised: >>> test = DocTestParser().get_doctest(''' ... >>> x = 1 ... >>> x ... 2 ... ''', {}, 'foo', 'foo.py', 0) >>> case = DocTestCase(test) >>> try: ... case.debug() ... except DocTestFailure, failure: ... pass DocTestFailure objects provide access to the test: >>> failure.test is test True As well as to the example: >>> failure.example.want '2\n' and the actual output: >>> failure.got '1\n'

def defaultTestResult(self):

*no docstring available*

def fail(self, msg=None):

Fail immediately, with the given message.

def failIf(self, expr, msg=None):

Fail the test if the expression is true.

def failIfAlmostEqual(self, first, second, places=7, msg=None):

Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).

def failIfEqual(self, first, second, msg=None):

Fail if the two objects are equal as determined by the '==' operator.

def failUnless(self, expr, msg=None):

Fail the test unless the expression is true.

def failUnlessAlmostEqual(self, first, second, places=7, msg=None):

Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit).

def failUnlessEqual(self, first, second, msg=None):

Fail if the two objects are unequal as determined by the '==' operator.

def failUnlessRaises(self, excClass, callableObj, *args, **kwargs):

Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception.

def format_failure(self, err):

*no docstring available*

def id(self):

*no docstring available*

def run(self, result=None):

*no docstring available*

def runTest(self):

*no docstring available*

def setUp(self):

*no docstring available*

def shortDescription(self):

*no docstring available*

def tearDown(self):

*no docstring available*

def __call__(self, *args, **kwds):

*no docstring available*

def __repr__(self):

*no docstring available*

def __repr__(self):

*no docstring available*