test: realign paren continuations in with _run_* calls

Mechanical whitespace-only follow-up to phases 1-2: continuation
lines that were paren-aligned to the old s = _spawn_* heads now align
to the with _run_* heads. Verified with git diff -w (empty).
This commit is contained in:
Andrew Hamilton 2026-09-09 23:35:30 +10:00
parent 1d3ae67dd8
commit 12b7b263bc

View file

@ -1047,7 +1047,7 @@ def test_standalone_headless_confined_pointer_clamps():
"""A CONFINED pointer constraint keeps the visible cursor inside the
constraint region even when relative motion would carry it outside."""
with _run_standalone({}, "%s --constrain confined "
"--confine-rect 100 100 200 150 '#00ff00'" % WL, wait="app0") as s:
"--confine-rect 100 100 200 150 '#00ff00'" % WL, wait="app0") as s:
assert s.proc.poll() is None
def patch_at(path, cx, cy, r=22):
@ -1101,7 +1101,7 @@ def test_standalone_headless_screen_mode_cursor_stays_aligned():
the layout derives from the committed state would otherwise let the two
split diagonally."""
with _run_standalone({}, "--screen-mode", "480x320",
"build/wltest '#ff0000'", wait="app0") as s:
"build/wltest '#ff0000'", wait="app0") as s:
assert s.proc.poll() is None, f"log tail:\n{s.read_log()[-400:]}"
def patch_at(path, cx, cy, r=22):
@ -1313,7 +1313,7 @@ def test_standalone_headless_cursor_theme_missing_uses_builtin(tmp_path):
empty.mkdir()
with _run_standalone({"XCURSOR_PATH": str(empty),
"XCURSOR_THEME": "DefinitelyMissingTheme"},
"build/wltest '#ff0000'") as s:
"build/wltest '#ff0000'") as s:
s.wait_app_active(0)
assert s.proc.poll() is None, f"log tail:\n{s.read_log()[-400:]}"
log = s.read_log()
@ -1398,7 +1398,7 @@ def test_standalone_headless_primary_selection_roundtrip(tmp_path):
payload into a file."""
out = tmp_path / "primary.out"
with _run_standalone({}, "%s --primary-set 'hello' '#ff0000'" % WL,
"%s --primary-demand '%s' '#00ff00'" % (WL, out), wait="any_frame") as s:
"%s --primary-demand '%s' '#00ff00'" % (WL, out), wait="any_frame") as s:
assert s.proc.poll() is None
# Active on boot is the last tab (the demander). Give the setter
# keyboard focus so it receives a seat-granted serial to set with --
@ -1839,8 +1839,8 @@ def test_nested_primary_selection_bridged(tmp_path):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
out = tmp_path / "primary.out"
with _run_nested("%s --primary-set 'hello' '#ff0000'" % WL,
"%s --primary-demand-expect '%s' hello '#00ff00'"
% (WL, out), wait="any_frame") as s:
"%s --primary-demand-expect '%s' hello '#00ff00'"
% (WL, out), wait="any_frame") as s:
assert s.proc.poll() is None
if s.active() != 0:
s.cycle(-1)
@ -1882,8 +1882,8 @@ def test_nested_host_primary_to_kick(tmp_path):
token = f"kick-h2n-{os.getpid()}-{time.monotonic_ns()}"
out = tmp_path / "primary.out"
with _run_nested("%s --primary-demand-expect '%s' '%s' '#00ff00'"
% (WL, out, token),
f"{WL} '#ff0000'", wait="any_frame") as s:
% (WL, out, token),
f"{WL} '#ff0000'", wait="any_frame") as s:
assert s.proc.poll() is None
# The host->nested primary bridge only exists over ext-data-control
# (a focus-based wl_data_device host has no primary channel at
@ -2141,7 +2141,7 @@ def test_standalone_headless_cursor_theme_none_boots(tmp_path):
empty = tmp_path / "empty-cursors"
empty.mkdir()
with _run_standalone({"XCURSOR_PATH": str(empty)},
"build/wltest '#ff0000'") as s:
"build/wltest '#ff0000'") as s:
s.wait_app_active(0)
assert s.proc.poll() is None, f"log tail:\n{s.read_log()[-400:]}"
log = s.read_log()
@ -2155,7 +2155,7 @@ def test_standalone_headless_cursor_theme_installed_no_warning():
if not os.path.exists("/usr/share/icons/Adwaita/cursors"):
pytest.skip("host has no Adwaita cursor theme")
with _run_standalone({"XCURSOR_THEME": "Adwaita"},
"build/wltest '#ff0000'") as s:
"build/wltest '#ff0000'") as s:
s.wait_app_active(0)
assert s.proc.poll() is None, f"log tail:\n{s.read_log()[-400:]}"
log = s.read_log()
@ -2176,7 +2176,7 @@ def test_standalone_cursor_shape_resets_on_tab_switch():
"""The per-tab cursor shape is cached and the switch to another tab resets
the compositor cursor to the default before its own shape is applied."""
with _run_standalone({}, "build/wltest '#0000ff'",
"build/wltest --cursor-shape text '#ff0000'") as s:
"build/wltest --cursor-shape text '#ff0000'") as s:
s.wait_app_active(1)
s.pointer_enter_until(r"\[cursor\] shape text")
baselines = s.read_log().count("[cursor] shape default")
@ -2254,7 +2254,7 @@ def test_standalone_headless_screen_mode_not_consumed_as_app():
"""--screen-mode is stripped from argv, so it must not become a tab
launcher (no 'starts with -' warning) while both real apps still boot."""
with _run_standalone({}, "--screen-mode", "640x480",
"build/wltest '#ff0000'", "build/wltest '#0000ff'", wait="any") as s:
"build/wltest '#ff0000'", "build/wltest '#0000ff'", wait="any") as s:
assert s.proc.poll() is None, f"log tail:\n{s.read_log()[-400:]}"
assert "starts with '-'" not in s.read_log(), \
f"--screen-mode leaked into the app list:\n{s.read_log()[-400:]}"
@ -2657,7 +2657,7 @@ def test_hold_alt_down_repeats():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} '{RED}'", f"{WL} '{BLUE}'",
repeat_off=False) as session:
repeat_off=False) as session:
start = session.wait_any_active()
assert start in (0, 1)
# Event-driven, no wall-clock rate assertion: arm the hold, wait for
@ -2903,7 +2903,7 @@ def test_sub_window_hidden_when_parent_not_active():
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
# Tab 0 (RED) opens a green extra toplevel from the same client.
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'", f"{WL} '{BLUE}'",
extra_args=("--tab-groups", "off"), wait="any") as s:
extra_args=("--tab-groups", "off"), wait="any") as s:
p0 = s.launch_pids()[0]
# The extra claims the slot right after tab 0 (app=1) with the same
# client pid as RED. BLUE can also claim app=1 (before the extra
@ -2994,7 +2994,7 @@ def test_sub_window_activates_when_parent_active():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'",
extra_args=("--tab-groups", "off")) as s:
extra_args=("--tab-groups", "off")) as s:
s.wait_any_active() # the single tab is crowned, then ...
# ... its sub-window activates on map. Assert the end state, not a
# particular line: depending on timing the arrival can promote via
@ -3013,7 +3013,7 @@ def test_sub_windows_stack_mode_never_claims_a_slot():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'",
extra_args=("--tab-groups", "on")) as s:
extra_args=("--tab-groups", "on")) as s:
s.wait_any_active() # app 0 crowned on its first map
s.wait_for(r"\[sub\] stack app=0\b")
s.wait_for(r"\[sub\] focus app=0\b")
@ -3051,7 +3051,7 @@ def test_sub_windows_stack_mode_focus_follows_tab():
# Tab 0 (RED) opens a green extra; tab 1 (BLUE) is the startup-selected
# active tab, so the extra must map hidden.
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'", f"{WL} '{BLUE}'",
extra_args=("--tab-groups", "on")) as s:
extra_args=("--tab-groups", "on")) as s:
# Settle: the extra must map while its tab is hidden, so tab 1 has
# to hold the settled crown (under load either tab can win it).
# NOTE: wait_surface_mapped(0) is deliberately NOT used: `map app=0`
@ -3104,7 +3104,7 @@ def test_sub_windows_stack_mode_unstack_refocuses_then_close():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'",
extra_args=("--tab-groups", "on"), wait="any") as s:
extra_args=("--tab-groups", "on"), wait="any") as s:
s.wait_for(r"\[sub\] focus app=0\b") # extra holds the keyboard
s.tap_ack(45) # 'X': close the extra
s.wait_for(r"\[sub\] unstack app=0\b")
@ -3127,7 +3127,7 @@ def test_sub_windows_stack_mode_row_title_follows_top():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'",
extra_args=("--tab-groups", "on"), wait="any") as s:
extra_args=("--tab-groups", "on"), wait="any") as s:
s.wait_for(r"\[sub\] focus app=0\b")
# Row titles are emitted at the data source (title change/set), so
# the extra's title must be resolvable without holding Alt open.
@ -3145,7 +3145,7 @@ def test_alt_delete_closes_active_window_not_tab():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'",
extra_args=("--tab-groups", "on"), wait="any") as s:
extra_args=("--tab-groups", "on"), wait="any") as s:
# [sub] stack logs when the member is *created*, before its Wayland
# surface has mapped. Alt+Delete sent too early sees only the tab's
# base window and closes the whole tab; the member taking keyboard
@ -3265,7 +3265,7 @@ def test_alt_left_right_cycle_tab_group_members():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} --extra '{GREEN}' '{RED}'",
extra_args=("--tab-groups", "on"), wait="any") as s:
extra_args=("--tab-groups", "on"), wait="any") as s:
s.wait_for(r"\[sub\] stack app=0\b")
s.mods(ALT)
try:
@ -3361,7 +3361,7 @@ def test_alt_shift_arrows_reorder_and_wrap():
os.environ["TERMINAL"] = f"{WL} '{RED}'"
try:
with _run_nested(f"{WL} '{RED}'", f"{WL} '{GREEN}'",
f"{WL} '{BLUE}'") as s:
f"{WL} '{BLUE}'") as s:
# Settle the startup crown (last mapper promotes itself under
# load), then make the third tab (index 2) active so there is a
# middle and an end to move through. Navigate by settled reads:
@ -3425,7 +3425,7 @@ def test_modifier_super_flag():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} '{RED}'", f"{WL} '{BLUE}'",
extra_args=["--modifier", "super"]) as s:
extra_args=["--modifier", "super"]) as s:
# Settle: under load either tab can hold the startup crown (last
# mapper promotes itself); read the settled crown, not a transient.
s.wait_surface_mapped(0)
@ -3680,7 +3680,7 @@ def test_start_cmd_index_selects_command():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} '{RED}'", f"{WL} '{GREEN}'", f"{WL} '{BLUE}'",
extra_args=["--start-cmd-index", "1"]) as s:
extra_args=["--start-cmd-index", "1"]) as s:
assert s.wait_any_active() == 0, \
"--start-cmd-index 1 should make the first command active"
assert s.proc.poll() is None
@ -4362,7 +4362,7 @@ def test_alt_shift_move_no_member_is_noop():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} '#ff0000'",
extra_args=("--tab-groups", "on"), wait="any") as s:
extra_args=("--tab-groups", "on"), wait="any") as s:
s.chord_ack(ALT | SHIFT, LEFT)
s.chord_ack(ALT | SHIFT, RIGHT)
assert s.proc.poll() is None
@ -5685,7 +5685,7 @@ def test_alt_tab_hold_repeats():
if not os.environ.get("WAYLAND_DISPLAY"):
pytest.skip("needs a live host Wayland session (WAYLAND_DISPLAY)")
with _run_nested(f"{WL} '{RED}'", f"{WL} '{BLUE}'",
repeat_off=False, wait="any") as session:
repeat_off=False, wait="any") as session:
session.wait_surface_mapped(1)
session.wait_surface_mapped(0)
session.active()