contextlib2 is a backport of the standard library’s contextlib module to earlier Python versions. It also serves as a real world proving ground for possible future enhancements to the standard library version. Development contextlib2 has no runtime dependencies, but requires unittest2 for testing on Python 2.x, as well as setuptools and wheel to generate universal wheel archives. Local testing is just a matter of running python test_contextlib2.py. Python3 is an optional dependency.