mirror of
https://github.com/codex-storage/deluge.git
synced 2025-01-11 03:55:43 +00:00
[Tests] Place logfiles from py.test run in _pytest_temp
This commit is contained in:
parent
6971e08b0d
commit
fd9e68e7e7
@ -1,3 +1,6 @@
|
||||
import os.path
|
||||
|
||||
import pytest
|
||||
from twisted.internet import defer
|
||||
from twisted.internet.error import CannotListenError
|
||||
|
||||
@ -29,6 +32,15 @@ class DaemonBase(object):
|
||||
if logfile == "":
|
||||
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):
|
||||
try:
|
||||
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
|
||||
pep8maxlinelength = 120
|
||||
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]
|
||||
commands =
|
||||
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]
|
||||
commands = py.test -v -s -m "gtkui" deluge/tests
|
||||
commands = py.test -v --basetemp=_pytest_temp -s -m "gtkui" deluge/tests
|
||||
|
||||
[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]
|
||||
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
|
||||
commands =
|
||||
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]
|
||||
setenv = PYTHONPATH = {env:PWD}:{env:PWD}/deluge/plugins
|
||||
commands =
|
||||
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]
|
||||
basepython = python2.6
|
||||
|
Loading…
x
Reference in New Issue
Block a user