Fallback to unittest2 when necessary

This commit is contained in:
Nick Coghlan 2012-05-01 20:42:19 +10:00
parent bccd39fa3a
commit 7d3f886c77
3 changed files with 8 additions and 2 deletions

View file

@ -4,7 +4,7 @@ Release History
0.4.0 (2012-05-??)
~~~~~~~~~~~~~~~~~~
* TBD
* Fall back to unittest2 if unittest is missing required functionality
0.3.1 (2012-01-17)

View file

@ -1,6 +1,9 @@
#!/usr/bin/env python
from distutils.core import setup
# Technically, unittest2 is a dependency to run the tests on 2.6 and 3.1
# Not sure how best to express that cleanly here
setup(
name='contextlib2',
version=open('VERSION.txt').read().strip(),

View file

@ -1,8 +1,11 @@
#!/usr/bin/env python
"""Unit tests for contextlib.py, and other context managers."""
"""Unit tests for contextlib2"""
import sys
import unittest
if not hasattr(unittest, "skipIf"):
import unittest2 as unittest
from contextlib2 import * # Tests __all__