diff --git a/repo2docker/app.py b/repo2docker/app.py index 4625ac3f..e11f36b6 100755 --- a/repo2docker/app.py +++ b/repo2docker/app.py @@ -611,7 +611,7 @@ class Repo2Docker(Application): else: # no port specified, pick a random one container_port = host_port = str(self._get_free_port()) - self.ports = {"%s/tcp" % container_port: host_port} + self.ports = {f"{container_port}/tcp": host_port} self.port = host_port # To use the option --NotebookApp.custom_display_url # make sure the base-notebook image is updated: diff --git a/tests/unit/test_ports.py b/tests/unit/test_ports.py index 445e6c4c..09944e87 100644 --- a/tests/unit/test_ports.py +++ b/tests/unit/test_ports.py @@ -96,7 +96,7 @@ def read_port_mapping_response( else: break else: - pytest.fail("Never succeeded in talking to %s" % url) + pytest.fail(f"Never succeeded in talking to {url}") assert "Directory listing" in r.text