Package test_suite :: Module relax_test_runner :: Class RelaxTestResult
[hide private]
[frames] | no frames]

Class RelaxTestResult

source code


A replacement for the TextTestResult class.

This class is designed to catch STDOUT and STDERR during the execution of each test and to prepend the output to the failure and error reports normally generated by TextTestRunner.

Instance Methods [hide private]
 
__init__(self, stream, descriptions, verbosity, timing=False)
Initialise the RelaxTestResult object with relax specific variables.
source code
 
addError(self, test, err)
Override of the TestResult.addError() method.
source code
 
addFailure(self, test, err)
Override of the TestResult.addFailure() method.
source code
 
addSuccess(self, test)
The method for a successful test.
source code
 
startTest(self, test)
Override of the TextTestResult.startTest() method.
source code
 
stopTest(self, test)
Override of the TextTestResult.stopTest() method.
source code
 
write_time(self, test_name)
Write the timing of the test to the stream.
source code

Inherited from unittest.runner.TextTestResult: addExpectedFailure, addSkip, addUnexpectedSuccess, getDescription, printErrorList, printErrors

Inherited from unittest.result.TestResult: __repr__, startTestRun, stop, stopTestRun, wasSuccessful

Inherited from unittest.result.TestResult (private): _count_relevant_tb_levels, _exc_info_to_string, _is_relevant_tb_level, _restoreStdout, _setupStdout

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]

Inherited from unittest.runner.TextTestResult: separator1, separator2

Inherited from unittest.result.TestResult (private): _moduleSetUpFailed, _previousTestClass, _testRunEntered

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, stream, descriptions, verbosity, timing=False)
(Constructor)

source code 

Initialise the RelaxTestResult object with relax specific variables.

Parameters:
  • timing (bool) - A flag which if True will enable timing of individual tests.
Overrides: object.__init__

addError(self, test, err)

source code 

Override of the TestResult.addError() method.

The STDOUT and STDERR captured text is prepended to the error text here.

Parameters:
  • test (TestCase instance) - The test object.
  • err (tuple of values) - A tuple of values as returned by sys.exc_info().
Overrides: unittest.result.TestResult.addError

addFailure(self, test, err)

source code 

Override of the TestResult.addFailure() method.

The STDOUT and STDERR captured text is prepended to the failure text here.

Parameters:
  • test (TestCase instance) - The test object.
  • err (tuple of values) - A tuple of values as returned by sys.exc_info().
Overrides: unittest.result.TestResult.addFailure

addSuccess(self, test)

source code 

The method for a successful test.

Parameters:
  • test (TestCase instance) - The test object.
Overrides: unittest.result.TestResult.addSuccess

startTest(self, test)

source code 

Override of the TextTestResult.startTest() method.

The start of STDOUT and STDERR capture occurs here.

Overrides: unittest.result.TestResult.startTest

stopTest(self, test)

source code 

Override of the TextTestResult.stopTest() method.

The end of STDOUT and STDERR capture occurs here.

Overrides: unittest.result.TestResult.stopTest

write_time(self, test_name)

source code 

Write the timing of the test to the stream.

Parameters:
  • test_name (str) - The TestCase name.