Skip to content

Open-source Python library for AI browser agents, plus Browser Use Cloud: stealth browsers and a hosted agent API.

test fix

Nick Sweeting89f83c9e899b
diff --git a/browser_use/browser/session.py b/browser_use/browser/session.py
index 565d26316..bf2443d2f 100644
--- a/browser_use/browser/session.py
+++ b/browser_use/browser/session.py
@@ -260,7 +260,7 @@ class BrowserSession(BaseModel):
try:
await (self.browser_context or self.browser).close()
logger.info(
- f'🛑 Stopped the Browser {self.browser_profile.channel.name.lower()} '
+ f'🛑 Stopped the {self.browser_profile.channel.name.lower()} browser '
f'keep_alive=False user_data_dir={_log_pretty_path(self.browser_profile.user_data_dir) or "<incognito>"} cdp_url={self.cdp_url or self.wss_url} pid={self.browser_pid}'
)
self.browser_context = None
@@ -271,11 +271,11 @@ class BrowserSession(BaseModel):
if self.browser_pid:
try:
psutil.Process(pid=self.browser_pid).terminate()
- logger.info(f'⏹ Killed the browser subprocess with browser_pid={self.browser_pid} (keep_alive=False)')
+ logger.info(f' ↳ Killed browser subprocess with browser_pid={self.browser_pid} keep_alive=False')
self.browser_pid = None
except Exception as e:
if 'NoSuchProcess' not in type(e).__name__:
- logger.debug(f'❌ Error terminating chrome subprocess pid={self.browser_pid}: {type(e).__name__}: {e}')
+ logger.debug(f'❌ Error terminating subprocess with browser_pid={self.browser_pid}: {type(e).__name__}: {e}')
async def close(self) -> None:
"""Deprecated: Provides backwards-compatibility with old class method Browser().close()"""
diff --git a/tests/ci/test_action_registry.py b/tests/ci/test_action_registry.py
index 327ccb60e..ec8fe8ece 100644
--- a/tests/ci/test_action_registry.py
+++ b/tests/ci/test_action_registry.py
@@ -1007,7 +1007,7 @@ class TestParameterOrdering:
assert model_fields['third'].default is True
@pytest.mark.asyncio
- async def test_extract_content_pattern(self, test_browser):
+ async def test_extract_content_pattern(self, test_browser, event_loop):
"""Test the specific extract_content pattern with special args between positional and kwargs"""
registry = Registry()
from langchain_core.language_models.chat_models import BaseChatModel