From ac942752969e6b47aacddc51a33c66eaf4c20627 Mon Sep 17 00:00:00 2001 From: titusfortner Date: Fri, 2 Dec 2022 16:50:44 -0600 Subject: [PATCH] [py] need to log both stdout and stderr from selenium manager --- py/selenium/webdriver/common/selenium_manager.py | 2 +- py/test/selenium/webdriver/common/selenium_manager_tests.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/py/selenium/webdriver/common/selenium_manager.py b/py/selenium/webdriver/common/selenium_manager.py index 7b2219038d0c6..a0cdacf520701 100644 --- a/py/selenium/webdriver/common/selenium_manager.py +++ b/py/selenium/webdriver/common/selenium_manager.py @@ -90,7 +90,7 @@ def run(args: Tuple[str, str, str]) -> str: stdout = completed_proc.stdout.decode("utf-8").rstrip("\n") stderr = completed_proc.stderr.decode("utf-8").rstrip("\n") if completed_proc.returncode: - raise SeleniumManagerException(f"Selenium manager failed for: {command}. {stderr}") + raise SeleniumManagerException(f"Selenium manager failed for: {command}.\n{stdout}{stderr}") else: # selenium manager exited 0 successfully, parse the executable path from stdout. return stdout.split("\t")[-1].strip() diff --git a/py/test/selenium/webdriver/common/selenium_manager_tests.py b/py/test/selenium/webdriver/common/selenium_manager_tests.py index 47d59856e40bc..1f0714d91d02e 100644 --- a/py/test/selenium/webdriver/common/selenium_manager_tests.py +++ b/py/test/selenium/webdriver/common/selenium_manager_tests.py @@ -28,7 +28,7 @@ def test_non_supported_browser_raises_sme(): def test_stderr_is_propagated_to_exception_messages(): - msg = 'Selenium manager failed for.*Error: "Invalid browser/driver name"' + msg = 'Selenium manager failed for:.* --browser foo\.\nERROR\tInvalid browser/driver name' with pytest.raises(SeleniumManagerException, match=msg): manager = SeleniumManager() binary = manager.get_binary()