Module unittest :: Class FunctionTestCase
[hide private]
[frames] | no frames]

type FunctionTestCase

object --+    
         |    
  TestCase --+
             |
            FunctionTestCase

A test case that wraps a test function.

This is useful for slipping pre-existing test functions into the PyUnit framework. Optionally, set-up and tidy-up functions can be supplied. As with TestCase, the tidy-up ('tearDown') function will always be called if the set-up ('setUp') function ran successfully.

Nested Classes [hide private]

Inherited from TestCase: failureException

Instance Methods [hide private]
 
__init__(self, testFunc, setUp=None, tearDown=None, description=None)
Create an instance of the class that will use the named test method when executed.
 
setUp(self)
Hook method for setting up the test fixture before exercising it.
 
tearDown(self)
Hook method for deconstructing the test fixture after testing it.
 
runTest(self)
 
id(self)
 
__str__(self)
 
__repr__(self)
 
shortDescription(self)
Returns a one-line description of the test, or None if no description has been provided.

Inherited from TestCase: __call__, assertAlmostEqual, assertAlmostEquals, assertEqual, assertEquals, assertFalse, assertNotAlmostEqual, assertNotAlmostEquals, assertNotEqual, assertNotEquals, assertRaises, assertTrue, assert_, countTestCases, debug, defaultTestResult, fail, failIf, failIfAlmostEqual, failIfEqual, failUnless, failUnlessAlmostEqual, failUnlessEqual, failUnlessRaises, run

Inherited from TestCase (private): _exc_info

Method Details [hide private]

__init__(self, testFunc, setUp=None, tearDown=None, description=None)
(Constructor)

 

Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name.

Overrides: TestCase.__init__
(inherited documentation)

setUp(self)

 

Hook method for setting up the test fixture before exercising it.

Overrides: TestCase.setUp
(inherited documentation)

tearDown(self)

 

Hook method for deconstructing the test fixture after testing it.

Overrides: TestCase.tearDown
(inherited documentation)

id(self)

 
Overrides: TestCase.id

__str__(self)
(Informal representation operator)

 
Overrides: TestCase.__str__

__repr__(self)
(Representation operator)

 
Overrides: TestCase.__repr__

shortDescription(self)

 

Returns a one-line description of the test, or None if no description has been provided.

The default implementation of this method returns the first line of the specified test method's docstring.

Overrides: TestCase.shortDescription
(inherited documentation)