diff --git a/CHANGELOG.md b/CHANGELOG.md index d68b0b04..0257ac88 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,9 @@ where X.Y.Z is the semver of the most recent choreographer release. ## [Unreleased] +### Fixed +- Build the `ChromeNotFoundError` message as one string, so it no longer prints as a tuple [[#314](https://github.com/plotly/choreographer/pull/314)], with thanks to @Blizzeq for the contribution! + ## [1.4.0] -- 2026-09-16 diff --git a/src/choreographer/browsers/chromium.py b/src/choreographer/browsers/chromium.py index f500c7dd..79207745 100644 --- a/src/choreographer/browsers/chromium.py +++ b/src/choreographer/browsers/chromium.py @@ -190,8 +190,8 @@ def __init__( raise ChromeNotFoundError( "Browser not found. You can use get_chrome() or " "choreo_get_chrome from bash. please see documentation. " - f"Local copy ignored: {self.skip_local}. ", - f"Path calculated:: {self.path}.", + f"Local copy ignored: {self.skip_local}. " + f"Path calculated: {self.path}.", ) _logger.info(f"Found chromium path: {self.path}") diff --git a/tests/test_chromium.py b/tests/test_chromium.py index 7512f4e1..f036a65c 100644 --- a/tests/test_chromium.py +++ b/tests/test_chromium.py @@ -1,6 +1,8 @@ from __future__ import annotations -from choreographer.browsers.chromium import Chromium +import pytest + +from choreographer.browsers.chromium import ChromeNotFoundError, Chromium from choreographer.channels import Pipe @@ -64,3 +66,16 @@ def test_empty_proxy_server_uses_environment_fallback(tmp_path, monkeypatch): cli = _get_cli(tmp_path, proxy_server="") assert "--proxy-server=http://environment.example:8080" in cli + + +def test_browser_not_found_message_is_one_string(tmp_path): + missing = tmp_path / "chrome" + channel = Pipe() + try: + with pytest.raises(ChromeNotFoundError) as excinfo: + Chromium(channel, missing) + finally: + channel.close() + + assert len(excinfo.value.args) == 1 + assert f"Path calculated: {missing}." in str(excinfo.value)