Package gavo :: Package helpers :: Module testhelpers :: Class VerboseTest
[frames] | no frames]

Class VerboseTest

source code

                 object --+        
                          |        
     unittest.case.TestCase --+    
                              |    
testresources.ResourcedTestCase --+
                                  |
                                 VerboseTest
Known Subclasses:

A TestCase with a couple of convenient assert methods.

Nested Classes

Inherited from unittest.case.TestCase: failureException

Instance Methods
 
assertEqualForArgs(self, callable, result, *args) source code
 
assertRaisesVerbose(self, exception, callable, args, msg) source code
 
assertRaisesWithMsg(self, exception, errMsg, callable, args, msg=None, **kwargs) source code
 
assertRuns(self, callable, args, msg=None) source code
 
assertAlmostEqualVector(self, first, second, places=7, msg=None) source code
 
assertEqualToWithin(self, a, b, ratio=1e-07, msg=None)
asserts that abs(a-b/(a+b))<ratio.
source code
 
assertOutput(self, toExec, argList, expectedStdout=None, expectedStderr='', expectedRetcode=0, input=None, stdoutStrings=None)
checks that execName called with argList has the given output and return value.
source code
 
assertEqualIgnoringAliases(self, result, expectation) source code

Inherited from testresources.ResourcedTestCase: setUp, setUpResources, tearDown, tearDownResources

Inherited from unittest.case.TestCase: __call__, __eq__, __hash__, __init__, __ne__, __providedBy__, __provides__, __repr__, __str__, addCleanup, addTypeEqualityFunc, assertAlmostEqual, assertAlmostEquals, assertDictContainsSubset, assertDictEqual, assertEqual, assertEquals, assertFalse, assertGreater, assertGreaterEqual, assertIn, assertIs, assertIsInstance, assertIsNone, assertIsNot, assertIsNotNone, assertItemsEqual, assertLess, assertLessEqual, assertListEqual, assertMultiLineEqual, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertNotIn, assertNotIsInstance, assertNotRegexpMatches, assertRaises, assertRaisesRegexp, assertRegexpMatches, assertSequenceEqual, assertSetEqual, assertTrue, assertTupleEqual, assert_, countTestCases, debug, defaultTestResult, doCleanups, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, id, run, shortDescription, skipTest

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

Class Methods

Inherited from unittest.case.TestCase: setUpClass, tearDownClass

Class Variables

Inherited from testresources.ResourcedTestCase: resources

Inherited from unittest.case.TestCase: __implemented__, longMessage, maxDiff

Properties

Inherited from object: __class__

Method Details

assertEqualToWithin(self, a, b, ratio=1e-07, msg=None)

source code 

asserts that abs(a-b/(a+b))<ratio.

If a+b are an underflow, we error out right now.

assertOutput(self, toExec, argList, expectedStdout=None, expectedStderr='', expectedRetcode=0, input=None, stdoutStrings=None)

source code 

checks that execName called with argList has the given output and return value.

expectedStdout and expectedStderr can be functions. In that case, the output is passed to the function, and an assertionError is raised if the functions do not return true.

The 0th argument in argList is automatically added, only pass "real" command line arguments.

toExec may also be a zero-argument python function. In that case, the process is forked and the function is called, with sys.argv according to argList. This helps to save startup time for python main functions.