diff options
author | Daniele Tricoli <eriol@mornie.org> | 2015-10-09 23:07:31 +0200 |
---|---|---|
committer | Daniele Tricoli <eriol@mornie.org> | 2015-10-09 23:07:31 +0200 |
commit | 2b3d330a120a16e97cecd5163b5d454dcfe38a2b (patch) | |
tree | 18760addd0640c90d4e2b6e867fa504e1f14d237 /test/__init__.py | |
parent | e6838673bda9af1e9bf7c4f71b25cf3e3dfc1253 (diff) | |
download | python-urllib3-2b3d330a120a16e97cecd5163b5d454dcfe38a2b.tar python-urllib3-2b3d330a120a16e97cecd5163b5d454dcfe38a2b.tar.gz |
Import python-urllib3_1.12.orig.tar.gz
Diffstat (limited to 'test/__init__.py')
-rw-r--r-- | test/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/__init__.py b/test/__init__.py index 172493c..f7c4a7a 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -56,6 +56,17 @@ def onlyPy27OrNewer(test): return test(*args, **kwargs) return wrapper +def onlyPy279OrNewer(test): + """Skips this test unless you are onl Python 2.7.9 or later.""" + + @functools.wraps(test) + def wrapper(*args, **kwargs): + msg = "{name} requires Python 2.7.9+ to run".format(name=test.__name__) + if sys.version_info < (2, 7, 9): + raise SkipTest(msg) + return test(*args, **kwargs) + return wrapper + def onlyPy3(test): """Skips this test unless you are on Python3.x""" |