genalog/tox.ini

63 строки
2.0 KiB
INI

[tox]
envlist = flake8, py
[testenv]
passenv =
# For e2e testing the OCR components
BLOB_KEY
BLOB_NAME
COGNITIVE_SERVICE_KEY
COMPUTER_VISION_SUBSCRIPTION_KEY
SEARCH_SERVICE_KEY
# Reading additional dependencies to run the test
# https://tox.readthedocs.io/en/latest/example/basic.html#depending-on-requirements-txt-or-defining-constraints
deps = -rrequirements-dev.txt
commands =
# {posargs} will be substituded by arguments after the `--` when running.
# This will allow running subset of the test suite via tox.
#
# EX: tox -- -m "not azure and not slow"
# will pass {-m "not azure and not slow"} to `pytest`
# See https://tox.readthedocs.io/en/latest/example/general.html for more details
pytest {posargs}
[testenv:flake8]
deps = flake8
skip_install = True
commands = flake8 .
# Configurations for running pytest
[pytest]
log_cli = False
log_format = %(asctime)s %(levelname)s %(message)s
junit_family = xunit2
# This enable custom marker as decorator "@pytest.mark.slow"
markers =
# These two markers allow to us to run faster subset of the test:
# EX: pytest -m "not slow and not azure"
# See https://docs.pytest.org/en/stable/example/markers.html#registering-markers
slow: marks tests as slow (deselect with '-m "not slow"')
azure: marks as integration tests that require azure resource
io: marks integration tests involving some form of I/O operations (disk, internet, etc)
testpaths =
tests
addopts =
# reports all (except passed tests). See https://docs.pytest.org/en/latest/usage.html#detailed-summary-report
-ra
--cov-append --cov=genalog --cov-report=html --cov-report=term-missing --cov-report=xml --junitxml=junit/test-results.xml
[flake8]
# Configs for flake8-import-order, see https://pypi.org/project/flake8-import-order/ for more info.
import-order-style=edited
application-import-names=genalog, tests
# Native flake8 configs
max-line-length = 140
exclude =
build, dist, docs, example,
.env*,.venv* # local virtual environments
.tox