diff --git a/tests/step_defs/server.py b/tests/step_defs/server.py index 0bac799..c6692ab 100644 --- a/tests/step_defs/server.py +++ b/tests/step_defs/server.py @@ -20,7 +20,6 @@ class Server: self.datadir.mkdir(parents=True) self.settings = {} self.use_config = True - # self.env = {} self.process = None self.loop = get_event_loop() @@ -77,12 +76,9 @@ class Server: def set_safe_port(self): """Set the server port to something not being used.""" port = 9090 + address = self.base_url.split(":")[0] while port == 9090: sock = socket() - if "address" in self.settings: - address = self.settings["address"] - else: - address = "127.0.0.1" sock.bind((address, 0)) port = sock.getsockname()[1] sock.close()