From 2cbbedf7be98fd3f43ab8897f68e36c18e2bef9a Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 22 Jul 2012 15:35:47 -0400 Subject: Added python 2.4-2.6 support for skipIf --HG-- branch : distribute extra : rebase_source : cac18ef7c3dbde38ceac3a0c71cfb3b5ffa56dd5 --- setuptools/tests/py26compat.py | 13 +++++++++++++ setuptools/tests/test_dist_info.py | 2 ++ 2 files changed, 15 insertions(+) create mode 100644 setuptools/tests/py26compat.py (limited to 'setuptools') diff --git a/setuptools/tests/py26compat.py b/setuptools/tests/py26compat.py new file mode 100644 index 00000000..ddf2ceb0 --- /dev/null +++ b/setuptools/tests/py26compat.py @@ -0,0 +1,13 @@ +import unittest + +try: + # provide skipIf for Python 2.4-2.6 + skipIf = unittest.skipIf +except AttributeError: + def skipIf(condition, reason): + def skipper(func): + def skip(*args, **kwargs): + return + if condition: + return skip + return func diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py index 318cd973..cf8fb0f9 100644 --- a/setuptools/tests/test_dist_info.py +++ b/setuptools/tests/test_dist_info.py @@ -13,6 +13,8 @@ except: import pkg_resources +from setuptools.tests.py26compat import skipIf + def DALS(s): "dedent and left-strip" return textwrap.dedent(s).lstrip() -- cgit v1.2.1