summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-11-20 10:36:37 -0200
committerdrebs <drebs@riseup.net>2017-11-20 10:56:43 -0200
commite4d594fca9fb42854bdc167aada9847acf6c231f (patch)
treef147a6271cabd91537544f206a041f0030758e2b
parent4f860fb97842a6e6a0a420889f99a87104fba498 (diff)
[test] always use a tempdir for server fixture config file
When starting up a Soledad Server through the use of a fixture in tests, a config file is created with the options needed for that test. As the config file was being created in /etc and not being removed, this was influencing servers started by other tests that don't use that fixture. By always using a temporary directory in the server fixture, we make sure that the config file is used only for that test and is removed after the test is finished. Closes: #8995
-rw-r--r--tests/conftest.py11
1 files changed, 1 insertions, 10 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index 59cce97e..36bed78b 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -205,16 +205,7 @@ class SoledadServer(object):
])
def _create_conf_file(self):
-
- # come up with name of the configuration file
- fname = '/etc/soledad/soledad-server.conf'
- if not os.access('/etc', os.W_OK):
- fname = os.path.join(self.tmpdir.strpath, 'soledad-server.conf')
-
- # create the configuration file
- dirname = os.path.dirname(fname)
- if not os.path.isdir(dirname):
- os.mkdir(dirname)
+ fname = os.path.join(self.tmpdir.strpath, 'soledad-server.conf')
with open(fname, 'w') as f:
blobs_path = os.path.join(str(self.tmpdir), 'blobs')
content = '''[soledad-server]