summaryrefslogtreecommitdiffstats
path: root/deluge/tests/daemon_base.py
diff options
context:
space:
mode:
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: