Isolate the remote registry in tests
Testing / remote-protocol-compat (0.16.0) (push) Successful in 40s
Testing / remote-protocol-compat (0.15.0) (push) Successful in 42s
Testing / test (push) Successful in 49s

Endpoint resolution consults remembered remotes, so tests that assert the
bare-domain :443 default failed on any machine with an explicit-port remote
remembered for the same host, while passing in CI. That made a real behavior
difference look like a local-only flake.

Isolate the registry for the whole suite instead of patching the two affected
tests, since any test touching endpoint resolution has the same hidden
dependency. Tests that need remembered entries still override the path.

Also replace the hardcoded personal remote host with a documentation domain.
This commit is contained in:
2026-08-09 20:45:56 +02:00
parent 581cd73cac
commit 1b32410575
2 changed files with 27 additions and 15 deletions
+12
View File
@@ -12,6 +12,18 @@ from browser_cli.remote import pool as _remote_pool
TEST_BROWSER_PROFILE = "testing"
@pytest.fixture(autouse=True)
def _isolate_remote_registry(monkeypatch, tmp_path):
"""Point the remembered-remote registry at an empty throwaway file.
Endpoint resolution consults remembered remotes, so without this a developer
who has remembered ``host:8765`` sees different results than CI for the same
code. Tests that need remembered entries still monkeypatch the path themselves.
"""
monkeypatch.setattr(
"browser_cli.remote.registry.REMOTE_REGISTRY_PATH", tmp_path / "empty-remotes.json"
)
@pytest.fixture(autouse=True)
def _clear_remote_pool():
"""Close any pooled remote connections between tests so a connection opened