summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordrebs <drebs@riseup.net>2017-11-20 11:53:36 -0200
committerdrebs <drebs@riseup.net>2017-11-20 11:53:36 -0200
commit3a7c3ec2f9f07291a3ce9d2b89c77fae963abde5 (patch)
tree8cab1c8bbcc3d9d07f6d6a32dccaf72a3a10e938 /tests
parentd74f27b75d69c37fac1587930508da6cd953f33c (diff)
[test] avoid failing when there's no couch_url in environment variable
Diffstat (limited to 'tests')
-rw-r--r--tests/server/test_tac.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/server/test_tac.py b/tests/server/test_tac.py
index 1ebe3308..7f52481c 100644
--- a/tests/server/test_tac.py
+++ b/tests/server/test_tac.py
@@ -68,12 +68,14 @@ class TacServerTestCase(unittest.TestCase):
twistd = os.path.join(path, 'bin', 'twistd')
args = [twistd, '--pidfile=', '-noy', TAC_FILE_PATH]
- # Use a special environment when running twistd.
+ # run Users API on port 2424 without TLS
+ env = {'DEBUG_SERVER': 'yes'}
+
+ # allow passing of couch url using environment variable, used by gitlab
+ # ci with docker
couch_url = os.environ.get('SOLEDAD_COUCH_URL')
- env = {
- 'DEBUG_SERVER': 'yes', # run Users API on port 2424 without TLS
- 'SOLEDAD_COUCH_URL': couch_url, # used by gitlab ci with docker
- }
+ if couch_url:
+ env.update({'SOLEDAD_COUCH_URL': couch_url})
protocol = ProcessProtocol()
proc = reactor.spawnProcess(protocol, twistd, args, env=env)