diff options
Diffstat (limited to 'tests/base.py')
-rw-r--r-- | tests/base.py | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/tests/base.py b/tests/base.py deleted file mode 100644 index cac65fd..0000000 --- a/tests/base.py +++ /dev/null @@ -1,36 +0,0 @@ -import sys -import unittest - -import six - - -class BaseTestCase(unittest.TestCase): - def assertIn(self, object, collection): - if six.PY2 and sys.version_info[1] <= 6: - return self.assertTrue(object in collection) - return super(BaseTestCase, self).assertIn(object, collection) - - -class Cleanup(object): - if sys.version_info < (2, 7): - # Provide a basic implementation of addCleanup for Python < 2.7 - def __init__(self, *args, **kwargs): - super(Cleanup, self).__init__(*args, **kwargs) - self._cleanups = [] - - def tearDown(self): - super(Cleanup, self).tearDown() - ok = True - while self._cleanups: - fn, args, kwargs = self._cleanups.pop(-1) - try: - fn(*args, **kwargs) - except KeyboardInterrupt: - raise - except: - ok = False - if not ok: - raise - - def addCleanup(self, function, *args, **kwargs): - self._cleanups.append((function, args, kwargs)) |