summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.zuul.yaml17
-rw-r--r--test/test_pyeclib_api.py44
-rw-r--r--tox.ini2
3 files changed, 41 insertions, 22 deletions
diff --git a/.zuul.yaml b/.zuul.yaml
index a886ee7..7d673e0 100644
--- a/.zuul.yaml
+++ b/.zuul.yaml
@@ -1,6 +1,21 @@
- project:
- experimental:
+ name: openstack/pyeclib
+ templates:
+ - openstack-python-jobs
+ - publish-to-pypi
+ check:
jobs:
+ - openstack-tox-py35
+ - openstack-tox-py36
+ - openstack-tox-py37
+ - pyeclib-tox-py27-centos-7
+ - libec-pyeclib-unit-centos-7
+ - libec-pyeclib-unit
+ gate:
+ jobs:
+ - openstack-tox-py35
+ - openstack-tox-py36
+ - openstack-tox-py37
- pyeclib-tox-py27-centos-7
- libec-pyeclib-unit-centos-7
- libec-pyeclib-unit
diff --git a/test/test_pyeclib_api.py b/test/test_pyeclib_api.py
index d53953a..31bedbd 100644
--- a/test/test_pyeclib_api.py
+++ b/test/test_pyeclib_api.py
@@ -30,6 +30,7 @@ import unittest
from distutils.version import StrictVersion
from itertools import combinations
+import six
import pyeclib.ec_iface
from pyeclib.ec_iface import ECBackendNotSupported
@@ -791,28 +792,31 @@ class TestPyECLibDriver(unittest.TestCase):
(baseline_usage, new_usage))
-class TestBackendsEnabled(unittest.TestCase):
+class BackendsEnabledMetaclass(type):
+ def __new__(meta, cls_name, cls_bases, cls_dict):
+ for ec_type in ALL_EC_TYPES:
+ def dummy(self, ec_type=ec_type):
+ if ec_type not in VALID_EC_TYPES:
+ raise unittest.SkipTest
+ if ec_type == 'shss':
+ k = 10
+ m = 4
+ elif ec_type == 'libphazr':
+ k = 4
+ m = 4
+ else:
+ k = 10
+ m = 5
+ ECDriver(k=k, m=m, ec_type=ec_type)
+ dummy.__name__ = 'test_%s_available' % ec_type
+ cls_dict[dummy.__name__] = dummy
+ return type.__new__(meta, cls_name, cls_bases, cls_dict)
+
+
+class TestBackendsEnabled(six.with_metaclass(BackendsEnabledMetaclass,
+ unittest.TestCase)):
'''Based on TestPyECLibDriver.test_valid_algo above, but these tests
should *always* either pass or skip.'''
- class __metaclass__(type):
- def __new__(meta, cls_name, cls_bases, cls_dict):
- for ec_type in ALL_EC_TYPES:
- def dummy(self, ec_type=ec_type):
- if ec_type not in VALID_EC_TYPES:
- raise unittest.SkipTest
- if ec_type == 'shss':
- k = 10
- m = 4
- elif ec_type == 'libphazr':
- k = 4
- m = 4
- else:
- k = 10
- m = 5
- ECDriver(k=k, m=m, ec_type=ec_type)
- dummy.__name__ = 'test_%s_available' % ec_type
- cls_dict[dummy.__name__] = dummy
- return type.__new__(meta, cls_name, cls_bases, cls_dict)
if __name__ == '__main__':
diff --git a/tox.ini b/tox.ini
index d5b2414..349e374 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py27,py35,pep8
+envlist = py27,py35,py36,py37,pep8
[testenv]
deps =