◐ Shell
clean mode source ↗

Message 241981 - Python tracker

There's a feature available via nose that might be nice to have in unittest: package-level setup and teardown functions.

Using nose, I can define a setUpModule() method in a test package's __init__.py and it will execute it during the test run. This is helpful for test packages that test related features and may have expensive setup/teardown routines. By having the test runner pick up setup/teardown methods in __init__.py, I can now incur this expense once rather than once per module.

I don't mind putting a patch together for this if others think this might be beneficial.