mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-04 15:38:43 +00:00
[Tests] Place logfiles from py.test run in _pytest_temp
This commit is contained in:
parent
6971e08b0d
commit
fd9e68e7e7
2 changed files with 18 additions and 6 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
import os.path
|
||||||
|
|
||||||
|
import pytest
|
||||||
from twisted.internet import defer
|
from twisted.internet import defer
|
||||||
from twisted.internet.error import CannotListenError
|
from twisted.internet.error import CannotListenError
|
||||||
|
|
||||||
|
@ -29,6 +32,15 @@ class DaemonBase(object):
|
||||||
if logfile == "":
|
if logfile == "":
|
||||||
logfile = "daemon_%s.log" % self.id()
|
logfile = "daemon_%s.log" % self.id()
|
||||||
|
|
||||||
|
# We are running py.test
|
||||||
|
if hasattr(pytest, "config"):
|
||||||
|
# Put log file in the py.test --basetemp argument
|
||||||
|
basetemp = pytest.config.option.basetemp
|
||||||
|
if basetemp:
|
||||||
|
if not os.path.exists(basetemp):
|
||||||
|
os.makedirs(basetemp)
|
||||||
|
logfile = os.path.join(basetemp, logfile)
|
||||||
|
|
||||||
for dummy in range(port_range):
|
for dummy in range(port_range):
|
||||||
try:
|
try:
|
||||||
d, self.core = common.start_core(listen_port=self.listen_port, logfile=logfile,
|
d, self.core = common.start_core(listen_port=self.listen_port, logfile=logfile,
|
||||||
|
|
12
tox.ini
12
tox.ini
|
@ -37,7 +37,7 @@ python_functions = test_
|
||||||
norecursedirs = .tox .git dist build
|
norecursedirs = .tox .git dist build
|
||||||
pep8maxlinelength = 120
|
pep8maxlinelength = 120
|
||||||
whitelist_externals= {[testenv]whitelist_externals}
|
whitelist_externals= {[testenv]whitelist_externals}
|
||||||
commands = py.test deluge
|
commands = py.test --basetemp=_pytest_temp deluge
|
||||||
|
|
||||||
|
|
||||||
##############
|
##############
|
||||||
|
@ -47,13 +47,13 @@ commands = py.test 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 -s -m "not (todo or gtkui)" deluge/tests
|
py.test -v --basetemp=_pytest_temp -s -m "not (todo or gtkui)" deluge/tests
|
||||||
|
|
||||||
[testenv:pygtkui]
|
[testenv:pygtkui]
|
||||||
commands = py.test -v -s -m "gtkui" deluge/tests
|
commands = py.test -v --basetemp=_pytest_temp -s -m "gtkui" deluge/tests
|
||||||
|
|
||||||
[testenv:todo]
|
[testenv:todo]
|
||||||
commands = py.test -v -s -m "todo" deluge/tests
|
commands = py.test -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
|
||||||
|
@ -64,13 +64,13 @@ commands = trial --reporter=deluge-reporter deluge/tests
|
||||||
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 -s -m "not gtkui" deluge/plugins
|
py.test -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 -s deluge/plugins
|
py.test -v --basetemp=_pytest_temp -s deluge/plugins
|
||||||
|
|
||||||
[testenv:py26]
|
[testenv:py26]
|
||||||
basepython = python2.6
|
basepython = python2.6
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue