Cleanup pytest config in tox

Config values are either wrong, unused or default is better.

Disable logging of deluge log output in testing.

Newer versions of pytest now use `pytest` cmd so rename.
This commit is contained in:
Calum Lind 2017-12-17 10:55:44 +00:00
parent f57286fd51
commit 4982ba0b98
1 changed files with 13 additions and 18 deletions

31
tox.ini
View File

@ -31,16 +31,12 @@ deps =
mock mock
slimit slimit
pillow pillow
whitelist_externals = py.test whitelist_externals = pytest
commands = {envpython} setup.py test commands = {envpython} setup.py test
[pytest] [pytest]
python_functions = test_ # Hide logged warnings and errors in test output.
norecursedirs = .tox .git dist build log_cli_level = CRITICAL
pep8maxlinelength = 120
whitelist_externals= {[testenv]whitelist_externals}
commands = py.test --basetemp=_pytest_temp deluge
############## ##############
# Unit tests # Unit tests
@ -49,13 +45,13 @@ commands = py.test --basetemp=_pytest_temp deluge
[testenv:pydef] [testenv:pydef]
commands = commands =
python -c "import libtorrent as lt; print(lt.__version__)" python -c "import libtorrent as lt; print(lt.__version__)"
py.test -v --basetemp=_pytest_temp -s -m "not (todo or gtkui)" deluge/tests pytest -v --basetemp=_pytest_temp -s -m "not (todo or gtkui)" deluge/tests
[testenv:pygtkui] [testenv:pygtkui]
commands = py.test -v --basetemp=_pytest_temp -s -m "gtkui" deluge/tests commands = pytest -v --basetemp=_pytest_temp -s -m "gtkui" deluge/tests
[testenv:todo] [testenv:todo]
commands = py.test -v --basetemp=_pytest_temp -s -m "todo" deluge/tests commands = pytest -v --basetemp=_pytest_temp -s -m "todo" deluge/tests
[testenv:trial] [testenv:trial]
setenv = {[testenv]setenv}:{env:PWD}/deluge/tests setenv = {[testenv]setenv}:{env:PWD}/deluge/tests
@ -67,13 +63,13 @@ commands =
setenv = PYTHONPATH = {env:PWD}:{env:PWD}/deluge/plugins setenv = PYTHONPATH = {env:PWD}:{env:PWD}/deluge/plugins
commands = commands =
python setup.py build_plugins --develop --install-dir={env:PWD}/deluge/plugins/ python setup.py build_plugins --develop --install-dir={env:PWD}/deluge/plugins/
py.test -v --basetemp=_pytest_temp -s -m "not gtkui" deluge/plugins pytest -v --basetemp=_pytest_temp -s -m "not gtkui" deluge/plugins
[testenv:pluginsgtkui] [testenv:pluginsgtkui]
setenv = PYTHONPATH = {env:PWD}:{env:PWD}/deluge/plugins setenv = PYTHONPATH = {env:PWD}:{env:PWD}/deluge/plugins
commands = commands =
python setup.py build_plugins --develop --install-dir={env:PWD}/deluge/plugins/ python setup.py build_plugins --develop --install-dir={env:PWD}/deluge/plugins/
py.test -v --basetemp=_pytest_temp -s deluge/plugins pytest -v --basetemp=_pytest_temp -s deluge/plugins
[testenv:py27] [testenv:py27]
deps = deps =
@ -119,13 +115,12 @@ ignore_errors = True
deps = deps =
{[testenv]deps} {[testenv]deps}
pylint pylint
# Use bash to enable use of wildcard paths with pylint.
whitelist_externals = bash
commands = commands =
pylint --version pylint --version
pylint deluge pylint deluge
bash -c 'pylint *.py deluge/scripts/*.py' # Use python to enable use of wildcard paths with pylint.
bash -c 'pylint deluge/plugins/*/deluge/' python -m pylint *.py deluge/scripts/*.py
python -m pylint deluge/plugins/*/deluge/
###################### ######################
@ -140,7 +135,7 @@ deps =
whitelist_externals = whitelist_externals =
{[testenv]whitelist_externals} {[testenv]whitelist_externals}
coverage coverage
commands = coverage run --branch --source=deluge -m py.test -m "not todo" deluge/tests/ commands = coverage run --branch --source=deluge -m pytest -m "not todo" deluge/tests/
[testenv:testcoverage] [testenv:testcoverage]
setenv = {[testenv]setenv} setenv = {[testenv]setenv}
@ -201,4 +196,4 @@ whitelist_externals =
commands = commands =
mkdir -p build/doccoverage mkdir -p build/doccoverage
sphinx-build -W -b coverage -d build/doctrees source build/doccoverage sphinx-build -W -b coverage -d build/doctrees source build/doccoverage
py.test --doctest-glob='*.rst' pytest --doctest-glob='*.rst'