Refactor to f-strings to comply with pyupgrade
MODIFY
repo2docker/app.py
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:

MODIFY
tests/unit/test_ports.py
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

Refactor to f-strings to comply with pyupgrade