The contextlib module that ships with Python 2.5 and newer is pretty neat; for example, it includes a tool to transform a decorator into a context manager. Neat, but not enough.
context_tools aims to pick up where contextlib leaves off.
It includes tools for turning context managers into setUp() and tearDown() methods for unittest-
and test_harness-based tests and into decorators for functions
and generators.
Interested? Grab the latest version.