summaryrefslogtreecommitdiffstats
path: root/deluge/tests/daemon_base.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 15:05:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-02-19 16:15:47 +0000
commitb686174b07bd56af4e5ffaa23c24f27f417fc305 (patch)
tree1ce335620d99341d94e88c159c0b9b0f6f0de5a0 /deluge/tests/daemon_base.py
parentAdding debian version 2.0.3-4. (diff)
downloaddeluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.tar.xz
deluge-b686174b07bd56af4e5ffaa23c24f27f417fc305.zip
Merging upstream version 2.1.1 (Closes: #1026291).
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'deluge/tests/daemon_base.py')
-rw-r--r--deluge/tests/daemon_base.py23
1 files changed, 7 insertions, 16 deletions
diff --git a/deluge/tests/daemon_base.py b/deluge/tests/daemon_base.py
index eda2193..3ae86c4 100644
--- a/deluge/tests/daemon_base.py
+++ b/deluge/tests/daemon_base.py
@@ -1,12 +1,9 @@
-# -*- coding: utf-8 -*-
#
# This file is part of Deluge and is licensed under GNU General Public License 3.0, or later, with
# the additional special exception to link portions of this program with the OpenSSL library.
# See LICENSE for more details.
#
-from __future__ import print_function, unicode_literals
-
import os.path
import pytest
@@ -14,18 +11,13 @@ from twisted.internet import defer
from twisted.internet.error import CannotListenError
import deluge.component as component
-from deluge.common import windows_check
from . import common
-class DaemonBase(object):
-
- if windows_check():
- skip = 'windows cant start_core not enough arguments for format string'
-
+@pytest.mark.usefixtures('config_dir')
+class DaemonBase:
def common_set_up(self):
- common.set_tmp_config_dir()
self.listen_port = 58900
self.core = None
return component.start()
@@ -56,12 +48,10 @@ class DaemonBase(object):
# 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)
+ if self.basetemp:
+ if not os.path.exists(self.basetemp):
+ os.makedirs(self.basetemp)
+ logfile = os.path.join(self.basetemp, logfile)
for dummy in range(port_range):
try:
@@ -74,6 +64,7 @@ class DaemonBase(object):
print_stdout=print_stdout,
print_stderr=print_stderr,
extra_callbacks=extra_callbacks,
+ config_directory=self.config_dir,
)
yield d
except CannotListenError as ex: