tests: the four tests that compose prefs through the core declare the exit of the lab

A new fixture, lab_exit (tests/conftest.py), declares the exit and the GeoIP database of the lab for one test that
is not e2e, as the e2e session has them (tests/_lab_egress.py). With no proxy the core asks the network where this
machine leaves from on every composition, even with a declared zone (zone, language and position come from the
exit): that is the product's rule, so the tests declare the answer instead of asking the internet.
This commit is contained in:
feder-cr committed 2026-11-25 22:45:33 +01:00
1 parent 464e0b132b
commit 7031c911c7
3 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -108,7 +108,7 @@ def test_default_context_viewport_follows_a_pinned_taskbar():
@pytest.mark.unit
def test_default_context_screen_matches_profile():
def test_default_context_screen_matches_profile(lab_exit):
ip = InvisiblePlaywright(seed=42)
kw = ip._default_context_kwargs()
p = ip._profile
@@ -125,7 +125,7 @@ def test_default_context_screen_matches_profile():
@pytest.mark.unit
def test_default_context_color_scheme_follows_dark_theme():
def test_default_context_color_scheme_follows_dark_theme(lab_exit):
"""The theme follows ``dark_theme``, but through the DECLARATION.
Previously the wrapper passed ``color_scheme`` to Playwright, which translated it
+1 -1
View File
@@ -46,7 +46,7 @@ DELIBERATE_VS_PUBLIC_API = {
}
def test_the_wrapper_composes_what_the_public_api_composes():
def test_the_wrapper_composes_what_the_public_api_composes(lab_exit):
profile = generate_profile(SEED)
mine = build_prefs(profile=profile, locale=LOCALE, timezone=TZ,
extra_prefs=None, virtual_display=False,
+1 -1
View File
@@ -16,7 +16,7 @@ from invisible_playwright import ensure_binary, get_default_stealth_prefs
pytestmark = pytest.mark.unit
def test_public_import_matches_direct_import():
def test_public_import_matches_direct_import(lab_exit):
"""The wrapper's re-export IS the core's function, not a copy of it."""
from invisible_core.config import get_default_stealth_prefs as _core