diff --git a/tests/conftest.py b/tests/conftest.py index 309ba1e4..12dce417 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -341,7 +341,7 @@ def serve_with_plugins(tmp_path): plugins_dir = tmp_path / "plugins" plugins_dir.mkdir(exist_ok=True) for module_name, source in plugins.items(): - (plugins_dir / "{}.py".format(module_name)).write_text(source, "utf-8") + (plugins_dir / f"{module_name}.py").write_text(source, "utf-8") port = find_free_port() proc = subprocess.Popen( [ @@ -365,7 +365,7 @@ def serve_with_plugins(tmp_path): processes.append(proc) if wait_for_startup: wait_until_responds( - "http://127.0.0.1:{}/-/versions.json".format(port), process=proc + f"http://127.0.0.1:{port}/-/versions.json", process=proc ) return proc, port diff --git a/tests/test_cli_serve_server.py b/tests/test_cli_serve_server.py index 824e186a..2f113ded 100644 --- a/tests/test_cli_serve_server.py +++ b/tests/test_cli_serve_server.py @@ -145,6 +145,8 @@ def test_startup_error_fails_fast_before_port_binds(serve_with_plugins): # confirms the socket was not left bound; on its own it cannot prove the # failure preceded the bind, since a port nothing ever touched also # refuses connections. - with pytest.raises(OSError): - with socket.create_connection(("127.0.0.1", port), timeout=0.2): - pass + with ( + pytest.raises(OSError), + socket.create_connection(("127.0.0.1", port), timeout=0.2), + ): + pass