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

Class FunctionTestCase

source code

object --+    
         |    
  TestCase --+
             |
            FunctionTestCase

A test case that wraps a test function.

This is useful for slipping pre-existing test functions into the unittest 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.
source code
 
setUp(self)
Hook method for setting up the test fixture before exercising it.
source code
 
tearDown(self)
Hook method for deconstructing the test fixture after testing it.
source code
 
runTest(self) source code
 
id(self) source code
 
__eq__(self, other) source code
 
__ne__(self, other) source code
 
__hash__(self)
hash(x)
source code
 
__str__(self)
str(x)
source code
 
__repr__(self)
repr(x)
source code
 
shortDescription(self)
Returns a one-line description of the test, or None if no description has been provided.
source code

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

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

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

source code 

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: object.__init__
(inherited documentation)

setUp(self)

source code 

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

Overrides: TestCase.setUp
(inherited documentation)

tearDown(self)

source code 

Hook method for deconstructing the test fixture after testing it.

Overrides: TestCase.tearDown
(inherited documentation)

id(self)

source code 
Overrides: TestCase.id

__eq__(self, other)
(Equality operator)

source code 
Overrides: TestCase.__eq__

__ne__(self, other)

source code 
Overrides: TestCase.__ne__

__hash__(self)
(Hashing function)

source code 

hash(x)

Overrides: object.__hash__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

shortDescription(self)

source code 

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)