Using trial there is no setUpClass neither tearDownClass, the setting up
of the environment needs to be in an external class to be able to call
it from inhereted classes.
--- /dev/null
+- Extract the environment set up and tear down for tests
@classmethod
def setUpClass(cls):
+ cls.setUpEnv()
+
+ @classmethod
+ def tearDownClass(cls):
+ cls.tearDownEnv()
+
+ @classmethod
+ def setUpEnv(cls):
"""
Sets up common facilities for testing this TestCase:
- custom PATH and HOME environmental variables
os.environ["HOME"] = cls.tempdir
@classmethod
- def tearDownClass(cls):
+ def tearDownEnv(cls):
"""
Cleanup common facilities used for testing this TestCase:
- restores the default PATH and HOME variables