From d25e6cd3bd92feb5f463d1f2a1ad8b410a696878 Mon Sep 17 00:00:00 2001 From: leaf-agent <318509791+leaf-agent@users.noreply.github.com> Date: Sat, 29 Aug 2026 21:55:17 +0000 Subject: [PATCH 1/3] Serve the examples by path so their shipped data comes with them --- tests/test_render_controls.py | 8 ++++++-- tests/test_render_gate.py | 4 +++- tests/test_render_options.py | 10 ++++++---- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/tests/test_render_controls.py b/tests/test_render_controls.py index de5e6da96..639b0e017 100644 --- a/tests/test_render_controls.py +++ b/tests/test_render_controls.py @@ -3073,7 +3073,9 @@ def test_the_ring_reading_names_every_way_a_box_can_draw_nothing_past_its_edge( stop would pass the other three and prove nothing. """ example = next(e for e in EXAMPLES if e.stem == "release-notes") - url = serve(example.read_text(), comments=2) + # The example, not a copy of its markup, so whatever it ships beside it is laid in + # too; its conversation stays off, which is the page this reading was written for. + url = serve(example, comments=2, seed_log=False) page, errors = open_page(browser, url) page.locator(".lf-sug-accept").first.focus() # The probe's control must begin clear of the viewport edge. Its subject is each @@ -3135,7 +3137,9 @@ def test_the_ring_reading_tells_a_ring_from_the_layers_other_outlines(browser, s The real ring goes last, as the control: without it a reading that claimed nothing at all would pass the three cases above and prove only that it was silent.""" example = next(e for e in EXAMPLES if e.stem == "release-notes") - url = serve(example.read_text(), comments=2) + # The example, not a copy of its markup, so whatever it ships beside it is laid in + # too; its conversation stays off, which is the page this reading was written for. + url = serve(example, comments=2, seed_log=False) page, errors = open_page(browser, url) page.locator(".lf-sug-accept").first.focus() diff --git a/tests/test_render_gate.py b/tests/test_render_gate.py index 21b28f38d..9e0d87164 100644 --- a/tests/test_render_gate.py +++ b/tests/test_render_gate.py @@ -234,7 +234,9 @@ def test_a_reload_mid_flight_never_wedges_round_trip(browser, serve): on one; the assertion is Traffic's books balancing, and then `round_trip` returning on a page whose only unfinished trip ended at the reload.""" gallery = next(p for p in EXAMPLES if p.stem == "gallery") - url = serve(gallery.read_text()) + # The example itself, so the data its markup selects is laid in beside it; its + # conversation is not, because the asks the cascade answers are the markup's. + url = serve(gallery, seed_log=False) # The console is not the subject here: a reload mid-post leaves Chrome's own # "Failed to load resource" behind, which is the navigation working. page, _ = open_page(browser, url) diff --git a/tests/test_render_options.py b/tests/test_render_options.py index fb7f1f87b..8c117068b 100644 --- a/tests/test_render_options.py +++ b/tests/test_render_options.py @@ -2480,11 +2480,11 @@ def test_the_specimen_gutter_is_painted_in_both_schemes(browser, serve): @pytest.mark.parametrize( - "html", - [SPECIMEN_PAGE, *(p.read_text() for p in SPECIMEN_EXAMPLES)], + "source", + [SPECIMEN_PAGE, *SPECIMEN_EXAMPLES], ids=["fixture", *(p.stem for p in SPECIMEN_EXAMPLES)], ) -def test_the_gutter_runs_beside_the_exhibit_and_no_further(html, browser, serve): +def test_the_gutter_runs_beside_the_exhibit_and_no_further(source, browser, serve): """The gutter marks what is quoted and nothing else, at both ends, and two separate things had to be true for that. The "quoted ·" note over the bar is the theme's word *about* the region rather than a word in it, and the bar opened at the note, drawing @@ -2508,7 +2508,9 @@ def test_the_gutter_runs_beside_the_exhibit_and_no_further(html, browser, serve) where the next one gets caught.""" from PIL import Image # a dev dependency already, for the demo recorder - page, errors = open_page(browser, serve(html)) + # The examples by path, so each is served with the data its markup selects; their + # conversations are left off, since the bar is drawn around what the markup exhibits. + page, errors = open_page(browser, serve(source, seed_log=False)) assert errors == [] scale = page.evaluate("() => devicePixelRatio") # Rendered, not merely present. A specimen inside a tab panel the page is not From dad6da3802ce3084fc5201504ade7a9ee02896ad Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Sat, 29 Aug 2026 15:04:11 -0700 Subject: [PATCH 2/3] Document complete example fixtures --- tests/CLAUDE.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/CLAUDE.md b/tests/CLAUDE.md index 9574f87bf..4d217a10a 100644 --- a/tests/CLAUDE.md +++ b/tests/CLAUDE.md @@ -287,10 +287,11 @@ once per worker for the ordinary layer, clones that initialized page for each te writes the document as v1, copies the example media that document names, adds the publishing note and any requested comments, then serves the directory with the real HTTP handler and page key. Handed an example's path rather than its markup it -also lays in the log that example ships, and sets the cursor past it: a page is -what its markup and its standing log make together, and a thread — or a widget a -message carries — exists nowhere else. Pass the markup where the log would be -noise for the subject, and say which in a comment. Reach its page directory through `serve.page_dir` +also lays in the external data and event log the example ships, and sets the cursor +past the log. Use `serve(example, seed_log=False)` when only the shipped conversation +would be noise; the external data still belongs to the example. A page is what its +markup and standing log make together, and a thread — or a widget a message carries — +exists nowhere else. Reach its page directory through `serve.page_dir` when a test needs to publish v2 or inspect the log; do not construct a parallel directory whose relationship to the served URL is implicit. `page_dir` in `interact_support.py` owns command-level files without starting a browser and clones From a165016bf04aa750816bfd43c27085c6a7b0c347 Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Sat, 29 Aug 2026 15:13:46 -0700 Subject: [PATCH 3/3] Keep fixture guidance in its owner --- tests/test_render_controls.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tests/test_render_controls.py b/tests/test_render_controls.py index ae33892c9..21ca60a89 100644 --- a/tests/test_render_controls.py +++ b/tests/test_render_controls.py @@ -3073,8 +3073,6 @@ def test_the_ring_reading_names_every_way_a_box_can_draw_nothing_past_its_edge( stop would pass the other three and prove nothing. """ example = next(e for e in EXAMPLES if e.stem == "release-notes") - # The example, not a copy of its markup, so whatever it ships beside it is laid in - # too; its conversation stays off, which is the page this reading was written for. url = serve(example, comments=2, seed_log=False) page, errors = open_page(browser, url) page.locator(".lf-sug-accept").first.focus() @@ -3137,8 +3135,6 @@ def test_the_ring_reading_tells_a_ring_from_the_layers_other_outlines(browser, s The real ring goes last, as the control: without it a reading that claimed nothing at all would pass the three cases above and prove only that it was silent.""" example = next(e for e in EXAMPLES if e.stem == "release-notes") - # The example, not a copy of its markup, so whatever it ships beside it is laid in - # too; its conversation stays off, which is the page this reading was written for. url = serve(example, comments=2, seed_log=False) page, errors = open_page(browser, url) page.locator(".lf-sug-accept").first.focus()