Support Python 3 using six
This commit is contained in:
parent
d653a3a3f7
commit
eedb4c4b73
67 changed files with 455 additions and 255 deletions
|
|
@ -1,5 +1,6 @@
|
|||
from __future__ import unicode_literals
|
||||
import boto
|
||||
import six
|
||||
from nose.plugins.skip import SkipTest
|
||||
|
||||
|
||||
|
|
@ -18,3 +19,19 @@ class requires_boto_gte(object):
|
|||
if boto_version >= required:
|
||||
return test
|
||||
raise SkipTest
|
||||
|
||||
|
||||
class py3_requires_boto_gte(object):
|
||||
"""Decorator for requiring boto version greater than or equal to 'version'
|
||||
when running on Python 3. (Not all of boto is Python 3 compatible.)"""
|
||||
def __init__(self, version):
|
||||
self.version = version
|
||||
|
||||
def __call__(self, test):
|
||||
if not six.PY3:
|
||||
return test
|
||||
boto_version = version_tuple(boto.__version__)
|
||||
required = version_tuple(self.version)
|
||||
if boto_version >= required:
|
||||
return test
|
||||
raise SkipTest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue