Isolate the remote registry in tests
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user