mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2025-05-23 05:56:19 +03:00
Split tests to python2 and python3
This commit is contained in:
parent
20dbeaffa6
commit
06526d9457
11
Makefile
11
Makefile
|
@ -42,10 +42,17 @@ install: uninstall clean cythonize
|
||||||
uninstall:
|
uninstall:
|
||||||
- pip uninstall -y -q dependency-injector 2> /dev/null
|
- pip uninstall -y -q dependency-injector 2> /dev/null
|
||||||
|
|
||||||
test: build
|
test-py2: build
|
||||||
# Unit tests with coverage report
|
# Unit tests with coverage report
|
||||||
coverage erase
|
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 report --rcfile=./.coveragerc
|
||||||
coverage html --rcfile=./.coveragerc
|
coverage html --rcfile=./.coveragerc
|
||||||
|
|
||||||
|
|
|
@ -18,8 +18,7 @@ if asyncio:
|
||||||
def _example(arg1, arg2, arg3, arg4):
|
def _example(arg1, arg2, arg3, arg4):
|
||||||
future = asyncio.Future()
|
future = asyncio.Future()
|
||||||
future.set_result(None)
|
future.set_result(None)
|
||||||
for _ in future:
|
yield from future
|
||||||
yield _
|
|
||||||
return arg1, arg2, arg3, arg4
|
return arg1, arg2, arg3, arg4
|
||||||
|
|
||||||
def _run(coro):
|
def _run(coro):
|
14
tox.ini
14
tox.ini
|
@ -6,11 +6,11 @@ envlist=
|
||||||
deps=
|
deps=
|
||||||
unittest2
|
unittest2
|
||||||
commands=
|
commands=
|
||||||
unit2 discover tests/unit
|
unit2 discover -s tests/unit -p test_*_py3.py
|
||||||
|
|
||||||
[testenv:coveralls]
|
[testenv:coveralls]
|
||||||
passenv=TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH DEPENDENCY_INJECTOR_DEBUG_MODE
|
passenv=TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH DEPENDENCY_INJECTOR_DEBUG_MODE
|
||||||
basepython=python2.7
|
basepython=python3.6
|
||||||
usedevelop=True
|
usedevelop=True
|
||||||
deps=
|
deps=
|
||||||
{[testenv]deps}
|
{[testenv]deps}
|
||||||
|
@ -19,10 +19,18 @@ deps=
|
||||||
coveralls
|
coveralls
|
||||||
commands=
|
commands=
|
||||||
coverage erase
|
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
|
coverage report --rcfile=./.coveragerc
|
||||||
coveralls
|
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]
|
[testenv:pylint]
|
||||||
deps=
|
deps=
|
||||||
pylint
|
pylint
|
||||||
|
|
Loading…
Reference in New Issue
Block a user