Split tests to python2 and python3

This commit is contained in:
Roman Mogylatov 2018-10-16 17:54:17 +03:00
parent 20dbeaffa6
commit 06526d9457
13 changed files with 21 additions and 7 deletions

View File

@ -42,10 +42,17 @@ install: uninstall clean cythonize
uninstall:
- pip uninstall -y -q dependency-injector 2> /dev/null
test: build
test-py2: build
# Unit tests with coverage report
coverage erase
coverage run --rcfile=./.coveragerc -m unittest2 discover tests/unit
coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*_py2_py3.py
coverage report --rcfile=./.coveragerc
coverage html --rcfile=./.coveragerc
test-py3: build
# Unit tests with coverage report
coverage erase
coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*py3.py
coverage report --rcfile=./.coveragerc
coverage html --rcfile=./.coveragerc

View File

@ -18,8 +18,7 @@ if asyncio:
def _example(arg1, arg2, arg3, arg4):
future = asyncio.Future()
future.set_result(None)
for _ in future:
yield _
yield from future
return arg1, arg2, arg3, arg4
def _run(coro):

14
tox.ini
View File

@ -6,11 +6,11 @@ envlist=
deps=
unittest2
commands=
unit2 discover tests/unit
unit2 discover -s tests/unit -p test_*_py3.py
[testenv:coveralls]
passenv=TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH DEPENDENCY_INJECTOR_DEBUG_MODE
basepython=python2.7
basepython=python3.6
usedevelop=True
deps=
{[testenv]deps}
@ -19,10 +19,18 @@ deps=
coveralls
commands=
coverage erase
coverage run --rcfile=./.coveragerc -m unittest2 discover tests/unit
coverage run --rcfile=./.coveragerc -m unittest2 discover -s tests/unit/ -p test_*_py3.py
coverage report --rcfile=./.coveragerc
coveralls
[testenv:py26]
commands=
unit2 discover -s tests/unit -p test_*_py2_py3.py
[testenv:py27]
commands=
unit2 discover -s tests/unit -p test_*_py2_py3.py
[testenv:pylint]
deps=
pylint