Add py33 target into tox.ini
Enable tests that could be imported into py33 environment. Part of blueprint bp/py33 Change-Id: I097e406cda3b86ad75e6f2f780b9a700b4fe42ef
This commit is contained in:
11
requirements-py3.txt
Normal file
11
requirements-py3.txt
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
Babel>=1.3
|
||||||
|
Flask>=0.10,<1.0
|
||||||
|
iso8601>=0.1.8
|
||||||
|
oslo.config>=1.2.0
|
||||||
|
paramiko>=1.8.0
|
||||||
|
pbr>=0.6,<1.0
|
||||||
|
psutil>=1.1.1
|
||||||
|
python3-memcached>=1.48
|
||||||
|
PyYAML>=3.1.0
|
||||||
|
sh
|
||||||
|
six>=1.5.2
|
@@ -108,10 +108,10 @@ def read_json_from_uri(uri):
|
|||||||
|
|
||||||
def make_range(start, stop, step):
|
def make_range(start, stop, step):
|
||||||
last_full = stop - ((stop - start) % step)
|
last_full = stop - ((stop - start) % step)
|
||||||
for i in xrange(start, last_full, step):
|
for i in six.moves.xrange(start, last_full, step):
|
||||||
yield xrange(i, i + step)
|
yield six.moves.xrange(i, i + step)
|
||||||
if stop > last_full:
|
if stop > last_full:
|
||||||
yield xrange(last_full, stop)
|
yield six.moves.xrange(last_full, stop)
|
||||||
|
|
||||||
|
|
||||||
def store_user(runtime_storage_inst, user):
|
def store_user(runtime_storage_inst, user):
|
||||||
|
@@ -13,7 +13,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
|
|
||||||
import itertools
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import mock
|
import mock
|
||||||
@@ -1070,17 +1069,17 @@ class TestRecordProcessor(testtools.TestCase):
|
|||||||
marks = list([r for r in runtime_storage_inst.get_all_records()
|
marks = list([r for r in runtime_storage_inst.get_all_records()
|
||||||
if r['record_type'] == 'mark'])
|
if r['record_type'] == 'mark'])
|
||||||
|
|
||||||
homer_mark = next(itertools.ifilter(
|
homer_mark = next(six.moves.filter(
|
||||||
lambda x: x['date'] == (timestamp - 1), marks), None)
|
lambda x: x['date'] == (timestamp - 1), marks), None)
|
||||||
self.assertTrue(homer_mark.get('disagreement'),
|
self.assertTrue(homer_mark.get('disagreement'),
|
||||||
msg='Disagreement: core set -2 after +2')
|
msg='Disagreement: core set -2 after +2')
|
||||||
|
|
||||||
homer_mark = next(itertools.ifilter(
|
homer_mark = next(six.moves.filter(
|
||||||
lambda x: x['date'] == (timestamp + 2), marks), None)
|
lambda x: x['date'] == (timestamp + 2), marks), None)
|
||||||
self.assertFalse(homer_mark.get('disagreement'),
|
self.assertFalse(homer_mark.get('disagreement'),
|
||||||
msg='No disagreement: core set +2 after +1')
|
msg='No disagreement: core set +2 after +1')
|
||||||
|
|
||||||
bart_mark = next(itertools.ifilter(
|
bart_mark = next(six.moves.filter(
|
||||||
lambda x: x['date'] == (timestamp + 3), marks), None)
|
lambda x: x['date'] == (timestamp + 3), marks), None)
|
||||||
self.assertTrue(bart_mark.get('disagreement'),
|
self.assertTrue(bart_mark.get('disagreement'),
|
||||||
msg='Disagreement: core set +2 after -1')
|
msg='Disagreement: core set +2 after -1')
|
||||||
@@ -1416,7 +1415,8 @@ def make_runtime_storage(users=None, companies=None, releases=None,
|
|||||||
return count
|
return count
|
||||||
|
|
||||||
def get_all_users():
|
def get_all_users():
|
||||||
for n in xrange(0, (runtime_storage_cache.get('user:count') or 0) + 1):
|
for n in six.moves.xrange(
|
||||||
|
0, (runtime_storage_cache.get('user:count') or 0) + 1):
|
||||||
u = runtime_storage_cache.get('user:%s' % n)
|
u = runtime_storage_cache.get('user:%s' % n)
|
||||||
if u:
|
if u:
|
||||||
yield u
|
yield u
|
||||||
|
12
tox.ini
12
tox.ini
@@ -1,5 +1,5 @@
|
|||||||
[tox]
|
[tox]
|
||||||
envlist = py26,py27,pep8
|
envlist = py26,py27,py33,pep8
|
||||||
minversion = 1.6
|
minversion = 1.6
|
||||||
skipsdist = True
|
skipsdist = True
|
||||||
|
|
||||||
@@ -15,6 +15,16 @@ deps = -r{toxinidir}/requirements.txt
|
|||||||
commands = python setup.py testr --testr-args='{posargs}'
|
commands = python setup.py testr --testr-args='{posargs}'
|
||||||
distribute = false
|
distribute = false
|
||||||
|
|
||||||
|
[testenv:py33]
|
||||||
|
basepython = python3
|
||||||
|
deps = -r{toxinidir}/requirements-py3.txt
|
||||||
|
-r{toxinidir}/test-requirements.txt
|
||||||
|
# to be removed once all tests passed
|
||||||
|
commands = python -m testtools.run \
|
||||||
|
tests.unit.test_utils \
|
||||||
|
tests.unit.test_mps \
|
||||||
|
tests.unit.test_record_processor
|
||||||
|
|
||||||
[testenv:pep8]
|
[testenv:pep8]
|
||||||
commands = flake8
|
commands = flake8
|
||||||
{toxinidir}/tools/requirements_style_check.sh requirements.txt test-requirements.txt
|
{toxinidir}/tools/requirements_style_check.sh requirements.txt test-requirements.txt
|
||||||
|
Reference in New Issue
Block a user