diff --git a/tests/server/test_tac.py b/tests/server/test_tac.py
index 1ebe3308c3168fc931b90a0cd51c5e83c74ae08f..7f52481cc9f0aa55d5c9b7ea6be0edf65cbbffff 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)