mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
Addition of setUpClass and setUpModule shared fixtures to unittest.
This commit is contained in:
parent
0d4bfec134
commit
5ffa325a82
5 changed files with 600 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue