Mon 25 Jun 2007
Just pushed out to PyPI…
The contextlib module that ships with Python 2.5 and newer is pretty neat; for example, it includes a tool to transform a generator into a context manager. Not a bad trick, 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. Both source and eggs for Python 2.5 are available, and just as soon as PyPI adds support for Python 3, a tarball for that will go up as well.
June 26th, 2007 at 15:41
Hmm, very cool ideas. I posted a more in-depth response here: http://farmdev.com/thoughts/26/context_tools-bridging-the-gap-between-test-methods-and-test-classes-/