Define utils for use in testing.
Decorate each test in a unittest.TestCase so it runs in its own directory.
TestCase methods setUp and tearDown are replaced with _new_setup and _new_teardown, above. Method _new_setup creates a temporary directory in which to run the test, stores it in self.tempdir, and then calls the original setUp method. Method _new_teardown first runs the original tearDown method, and then returns to the original starting directory and deletes the temporary directory.
TestCase being decorated to use a tempdir for each test.
The decorated TestCase class.