Repository navigation
test: adopt the shared configuration helpers across the test suite - #476
Merged
has2k1 merged 3 commits intoOct 29, 2026
Merged
Conversation
Replace module-local helpers that wrote and loaded `great-docs.yml`, and matching inline write-and-load pairs, with the shared `write_config` helper from test support. Each call supplies its YAML directly, including `show_dates: true`, previously a module default, and `site: lang`, previously composed from a language code. Configurations previously written to a separate `config` subdirectory now load from each test's own directory.
Use the shared `mock_config` double for project configuration. It rejects settings absent from the real configuration. The previous mocks had no specification, so unset settings evaluated as true. Each test already supplies the settings its code path reads, so test behaviour is unchanged.
Use the shared `mock_config` double for project configuration. The previous mocks had no specification, so unset settings evaluated as true. The double provides empty `user_settings` and no sections unless a test overrides them. Remove seven stubs for a `get` method that the real configuration does not have and lint never called.
📚 Preview this PR's docs locallyFetch the just-built site and open it in your browser: # this exact build
great-docs preview --run 40915693034
# or always the latest build for this PR
great-docs preview --pr 476Auth & tips
|
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.
This PR replaces the per-file helpers that wrote and loaded
great-docs.yml, and theMagicMockconfiguration doubles, with the sharedwrite_configandmock_confighelpers intests/support.py.Eleven test files each carried their own copy of the write-and-load helper, some with their own defaults. The
MagicMockdoubles read any setting a test forgot to set as true, so a test could pass through a branch other than the one it was written for;mock_configreads unset settings as empty and rejects namesConfigdoes not have.