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:
parent
edeafd6159
commit
81ef5f0731
4 changed files with 49 additions and 1 deletions
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -6,6 +6,9 @@
|
|||
# Visual Studio Code configuration
|
||||
/.vscode
|
||||
|
||||
# tox related files
|
||||
.tox/
|
||||
|
||||
# Coverage related
|
||||
/htmlcov/
|
||||
/.coverage
|
||||
|
|
16
README.rst
16
README.rst
|
@ -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 .
|
||||
|
|
|
@ -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
29
tox.ini
Normal 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/
|
Loading…
Add table
Add a link
Reference in a new issue