pungi/tox.ini
Haibo Lin 3c72755814 Use pytest instead of nosetests
Nose has been in maintenance mode for the past several years
and pytest is a good replacement.

Other changes:
- Replace deprecated assertRegexpMatches with assertRegex
- Replace deprecated assertRaisesRegexp with assertRaisesRegex
- Replace deprecated SafeConfigParser with ConfigParser
- Force reinstall pytest and mock in tox virtualenv. This is because
  the globally installed packages may not work as expected(occured in
  jenkins job).

JIRA: RHELCMP-1619
Signed-off-by: Haibo Lin <hlin@redhat.com>
2020-07-29 14:57:16 +08:00

98 lines
1.8 KiB
INI

[tox]
envlist = flake8, black, py27, py3
[testenv:flake8]
deps =
flake8
whitelist_externals = sh
commands =
sh -c "flake8 pungi pungi_utils setup.py tests/*py"
[testenv:black]
basepython = python3
whitelist_externals = sh
deps =
{[testenv:flake8]deps}
black
commands =
{[testenv:flake8]commands}
black --check --diff pungi pungi_utils setup.py tests --exclude tests/_composes
[testenv:py27]
sitepackages = true
deps =
funcsigs
productmd
jsonschema
fedmsg
ordered_set
python-multilib
modulemd
kobo
koji
pykickstart
lxml
dogpile.cache
mmdzanata
parameterized
dict.sorted
urlgrabber
mock
unittest2
pytest
pytest-cov
whitelist_externals =
sh
make
coverage
commands =
sh -c 'find . -name "*.pyc" -exec rm -f \{\} +'
pip install --force-reinstall pytest mock
make test-coverage
coverage xml
[testenv:py3]
sitepackages = true
deps =
funcsigs
productmd
jsonschema
fedmsg
ordered_set
python-multilib
unittest2
modulemd
kobo
koji
pykickstart
lxml
dogpile.cache
mmdzanata
parameterized
dict.sorted
mock
pytest
whitelist_externals =
sh
make
commands =
sh -c 'find . -name "__pycache__" -exec rm -rf \{\} +'
pip install --force-reinstall pytest mock
make test
[flake8]
exclude = doc/*,*.pyc,*.py~,*.in,*.spec,*.sh,*.rst
filename = *.py
max-line-length = 88
# E402: module level import not at top of file
# H301: one import per line
# H306: imports not in alphabetical order
# E226: missing whitespace around arithmetic operator
# W503: line break occured before a binary operator
# E203: whitespace before ':'
ignore = E402,H301,H306,E226,W503,E203
[pytest]
addopts = --ignore=tests/_composes