1
mirror of https://github.com/home-assistant/core synced 2024-07-27 18:58:57 +02:00
ha-core/tox.ini
Jason Hu 8ef2cfa364 Try to fix coveralls unstable result (#15800)
* Create one tox env for code coverage report

pytest-cov generated report in project root folder, not tox env folder.

* Add cov tox env to travis

* Coveralls seems expecting all build jobs upload

* Only upload coverage after cov env success
2018-08-06 10:51:37 +02:00

62 lines
2.0 KiB
INI

[tox]
envlist = py35, py36, py37, py38, lint, pylint, typing, cov
skip_missing_interpreters = True
[testenv]
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/homeassistant
; both temper-python and XBee modules have utf8 in their README files
; which get read in from setup.py. If we don't force our locale to a
; utf8 one, tox's env is reset. And the install of these 2 packages
; fail.
whitelist_externals = /usr/bin/env
install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages}
commands =
pytest --timeout=9 --duration=10 {posargs}
deps =
-r{toxinidir}/requirements_test_all.txt
-c{toxinidir}/homeassistant/package_constraints.txt
[testenv:cov]
basepython = {env:PYTHON3_PATH:python3}
setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/homeassistant
; both temper-python and XBee modules have utf8 in their README files
; which get read in from setup.py. If we don't force our locale to a
; utf8 one, tox's env is reset. And the install of these 2 packages
; fail.
whitelist_externals = /usr/bin/env
install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages}
commands =
pytest --timeout=9 --duration=10 --cov --cov-report= {posargs}
deps =
-r{toxinidir}/requirements_test_all.txt
-c{toxinidir}/homeassistant/package_constraints.txt
[testenv:pylint]
basepython = {env:PYTHON3_PATH:python3}
ignore_errors = True
deps =
-r{toxinidir}/requirements_all.txt
-r{toxinidir}/requirements_test.txt
-c{toxinidir}/homeassistant/package_constraints.txt
commands =
pylint {posargs} homeassistant
[testenv:lint]
basepython = {env:PYTHON3_PATH:python3}
deps =
-r{toxinidir}/requirements_test.txt
commands =
python script/gen_requirements_all.py validate
flake8
pydocstyle homeassistant tests
[testenv:typing]
basepython = {env:PYTHON3_PATH:python3}
whitelist_externals=/bin/bash
deps =
-r{toxinidir}/requirements_test.txt
commands =
/bin/bash -c 'mypy homeassistant/*.py homeassistant/util/'