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
resolve pytest-httpserver hanging on stop after test cleanup
Nick Sweetingfc0af9e1e9de
diff --git a/pyproject.toml b/pyproject.tomlindex b2621b1e2..04b29b0a1 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -2,7 +2,7 @@name = "browser-use"description = "Make websites accessible for AI agents"authors = [{ name = "Gregor Zunic" }]-version = "0.5.0"+version = "0.5.1"readme = "README.md"requires-python = ">=3.11,<4.0"classifiers = [diff --git a/tests/ci/conftest.py b/tests/ci/conftest.pyindex 5641c7f8e..426143ba5 100644--- a/tests/ci/conftest.py+++ b/tests/ci/conftest.py@@ -5,6 +5,7 @@ Sets up environment variables to ensure tests never connect to production servic"""import os+import socketserverimport tempfilefrom unittest.mock import AsyncMock@@ -12,6 +13,12 @@ import pytestfrom dotenv import load_dotenvfrom pytest_httpserver import HTTPServer+# Fix for httpserver hanging on shutdown - prevent blocking on socket close+# This prevents tests from hanging when shutting down HTTP servers+socketserver.ThreadingMixIn.block_on_close = False+# Also set daemon threads to prevent hanging+socketserver.ThreadingMixIn.daemon_threads = True+from browser_use.agent.views import AgentOutputfrom browser_use.controller.service import Controllerfrom browser_use.llm import BaseChatModel