Addition of setUpClass and setUpModule shared fixtures to unittest.

This commit is contained in:
Michael Foord 2010-03-07 22:04:55 +00:00
parent 0d4bfec134
commit 5ffa325a82
5 changed files with 600 additions and 11 deletions

View file

@ -153,6 +153,9 @@ class TestCase(object):
longMessage = False
# Attribute used by TestSuite for classSetUp
_classSetupFailed = False
def __init__(self, methodName='runTest'):
"""Create an instance of the class that will use the named test
@ -211,6 +214,14 @@ class TestCase(object):
"Hook method for deconstructing the test fixture after testing it."
pass
@classmethod
def setUpClass(cls):
"Hook method for setting up class fixture before running tests in the class."
@classmethod
def tearDownClass(cls):
"Hook method for deconstructing the class fixture after running all tests in the class."
def countTestCases(self):
return 1