diff options
author | Daniele Tricoli <eriol@mornie.org> | 2015-10-09 23:19:30 +0200 |
---|---|---|
committer | Daniele Tricoli <eriol@mornie.org> | 2015-10-09 23:19:30 +0200 |
commit | cd2a4010a9e1356c36cfb42b57501343c29e2608 (patch) | |
tree | 81af3946a53bb27e34e85eb28035ace8c3e7b27e /test/__init__.py | |
parent | ebc01af6ebb87c1e27e50b4ea572b8c1a20e70b0 (diff) | |
parent | 7db0aa9b18e70f43ef0bfcdec7f223e5b681aaf0 (diff) | |
download | python-urllib3-cd2a4010a9e1356c36cfb42b57501343c29e2608.tar python-urllib3-cd2a4010a9e1356c36cfb42b57501343c29e2608.tar.gz |
merge patched into master
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 7ea6358..22d3616 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""" |