Repository navigation
Split the four largest browser test modules into packages by subject - #3087
Merged
Merged
Conversation
test_render_navigation, _threads, _widgets and _margin (11k-15k lines
each) become tests/browser/{navigation,threads,widgets,margin}/, 47
modules of 400-2000 lines, each named and documented for the behavior
it protects. A helper one module uses moves with it; the package's
__init__.py holds those several modules or other directories import.
Constants only a journeys module used move into that module.
Every definition is unchanged except the widgets tests that located
examples through Path(__file__).parents[N], which now read
render_harness.ROOT. The collected test ids are identical before and
after.
--changed-since read base sources only one directory deep, so every
test in a package would have counted as edited on each landing; it now
reads them at any depth. tests/AGENTS.md states the package layout.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
# Conflicts: # tests/browser/test_render_margin.py # tests/browser/test_render_navigation.py # tests/browser/test_render_widgets.py # tests/journeys/test_render_drafts.py
leaf-agent
approved these changes
Oct 16, 2026
max-sixty
added a commit
that referenced
this pull request
Oct 16, 2026
The second round after #3087: six more test modules of 6k–7.7k lines become packages by subject, laid out the same way. | Source | Package | Modules | |---|---|---| | `browser/test_render_projection.py` | `browser/projection/` | 10 | | `browser/test_render_drafts.py` | `browser/drafts/` | 10 | | `browser/test_render_startup.py` | `browser/startup/` | 10 | | `browser/test_render_controls.py` | `browser/controls/` | 9 | | `model/test_interact_contract.py` | `model/interact_contract/` | 10 | | `process/test_website_server.py` | `process/website_server/` | 9 | **New in this round.** `website_server`'s autouse fixture has to reach every module, so the package's `conftest.py` imports it, and `tests/AGENTS.md` now says that. The three regtest recordings move beside their tests' new modules, and the reset command they quote names the new path. The three modules that took `leaf_page` through `test_render_controls` import it from `render_harness`, where it is defined. Definitions only a journeys module reached, directly or through another such definition, move into that module (most of them into `journeys/test_render_controls.py`). **Nothing else in the moved code changed.** Each package collects the same test ids as its source, and every definition's AST matches `main`'s except for the quoted paths above, function-local imports ruff dropped where the new module imports the same name at the top, one `Path(__file__).parents[N]` deepened, and a docstring that pointed at "the rule above" across what is now a module boundary. All model and process tests in the new packages and their importers pass (494), as does the first browser test of each new module. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The four largest browser test modules,
test_render_navigation,_threads,_widgetsand_margin(11k–15k lines each), become packages undertests/browser/:navigation/,threads/,widgets/andmargin/, 47 modules of 400–2000 lines, each named and documented for the behavior it protects.What moved where. A helper or constant one module uses moves with it; one that several modules use, or that another directory imports, goes in the package's
__init__.py. The eleven definitions only ajourneys/module used now live in that module.tests/AGENTS.mdstates the layout beside the existing cross-tier module convention.Nothing in the moved code changed, checked two ways: every top-level definition's AST is identical to
main's, and the collected test ids are identical (1037 before and after). The exception is twelve widgets definitions that found examples throughPath(__file__).parents[N], which would have pointed one directory too high; they now readrender_harness.ROOT.--changed-sincereads nested modules._base_sourcesintests/conftest.pymatched base test files only one directory deep, so every test in a package would have counted as edited on each landing and run in every gate. It now matches any depth; on this branch the selection adds only the 15 browser tests whose source text changed (theROOTreads and the rewritten inline imports).Branches that edit these four modules will conflict with this once it lands: a change to a test there moves to the module that now holds the test.