Add a tox.ini file and ignore the generated .tox folder

Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>
This commit is contained in:
Pierre-Yves Chibon 2020-06-19 17:10:13 +02:00
parent edeafd6159
commit 81ef5f0731
4 changed files with 49 additions and 1 deletions

3
.gitignore vendored
View file

@ -6,6 +6,9 @@
# Visual Studio Code configuration
/.vscode
# tox related files
.tox/
# Coverage related
/htmlcov/
/.coverage

View file

@ -80,3 +80,19 @@ Follow these simples steps:
::
PYTHONPATH=. fedora-messaging --conf=toddlers.toml consume
How to run the tests?
---------------------
* Simply install:
::
dnf install python3-tox
* And run the tests:
::
tox .

View file

@ -9,4 +9,4 @@ application-import-names = toddlers
import-order-style = google
[tool:pytest]
addopts = --cov-config .coveragerc --cov=toddlers --cov-report term --cov-report xml --cov-report html
addopts = --cov-config .coveragerc --cov=toddlers --cov-report=term-missing --cov-report xml --cov-report html

29
tox.ini Normal file
View file

@ -0,0 +1,29 @@
[tox]
envlist = py36,py37,py38,black,flake8
# If the user is missing an interpreter, don't fail
skip_missing_interpreters = True
skipsdist = True
[testenv]
deps =
pytest
pytest-cov
koji
fedora_messaging
requests
setenv =
PYTHONPATH={toxinidir}
commands =
pytest tests/
[testenv:black]
deps =
black
commands =
black --check --diff .
[testenv:flake8]
deps =
flake8
commands =
flake8 toddlers/