Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.
Python ai-agentsai-toolsbrowser-agentbrowser-automationbrowser-usecdpcloud-browsercomputer-useheadless-browserllmmcpplaywrightpythonremote-browserstealth-browserweb-automationweb-scraping
fix(tests): patch TimeoutWrappedCDPClient at its new construction site
Saurav Panda44e7b1f0823a
diff --git a/tests/ci/browser/test_cdp_headers.py b/tests/ci/browser/test_cdp_headers.pyindex 7cde03978..e38c7e272 100644--- a/tests/ci/browser/test_cdp_headers.py+++ b/tests/ci/browser/test_cdp_headers.py@@ -48,7 +48,7 @@ async def test_cdp_client_headers_passed_on_connect():session = BrowserSession(cdp_url='wss://remote-browser.example.com/cdp', headers=test_headers)- with patch('browser_use.browser.session.CDPClient') as mock_cdp_client_class:+ with patch('browser_use.browser.session.TimeoutWrappedCDPClient') as mock_cdp_client_class:# Setup mock CDPClient instancemock_cdp_client = AsyncMock()mock_cdp_client_class.return_value = mock_cdp_client@@ -98,7 +98,7 @@ async def test_cdp_client_no_headers_when_none():assert session.browser_profile.headers is None- with patch('browser_use.browser.session.CDPClient') as mock_cdp_client_class:+ with patch('browser_use.browser.session.TimeoutWrappedCDPClient') as mock_cdp_client_class:mock_cdp_client = AsyncMock()mock_cdp_client_class.return_value = mock_cdp_clientmock_cdp_client.start = AsyncMock()@@ -145,7 +145,7 @@ async def test_headers_used_for_json_version_endpoint():mock_response.json.return_value = {'webSocketDebuggerUrl': 'ws://remote-browser.example.com:9222/devtools/browser/abc'}mock_client.get = AsyncMock(return_value=mock_response)- with patch('browser_use.browser.session.CDPClient') as mock_cdp_client_class:+ with patch('browser_use.browser.session.TimeoutWrappedCDPClient') as mock_cdp_client_class:mock_cdp_client = AsyncMock()mock_cdp_client_class.return_value = mock_cdp_clientmock_cdp_client.start = AsyncMock()