unittest.FunctionTestCase

unittest :: FunctionTestCase :: 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 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. | source code
__repr__(self) | source code
__str__(self) | source code
id(self) | source code
runTest(self) | source code
setUp(self) Hook method for setting up the test fixture before exercising it. | source code
shortDescription(self) Returns a one-line description of the test, or None if no description has been provided. | source code
tearDown(self) Hook method for deconstructing the test fixture after testing it. | 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__`, `__getattribute__`, `__hash__`, `__new__`, `__reduce__`, `__reduce_ex__`, `__setattr__`

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

### __repr__(self) (Representation operator) | source code
Overrides: TestCase.__repr__

### __str__(self) (Informal representation operator) | source code
Overrides: TestCase.__str__

### id(self) | source code
Overrides: TestCase.id

### setUp(self) | source code
Hook method for setting up the test fixture before exercising it. Overrides: TestCase.setUp (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)

### tearDown(self) | source code
Hook method for deconstructing the test fixture after testing it. Overrides: TestCase.tearDown (inherited documentation)