Repository navigation
Add --showlocals to all pytest configurations - #1286
Merged
Merged
Conversation
Add '--showlocals' option to pytest configurations across all projects to ensure consistent behavior when displaying local variables in test failures. Pytest does not merge addopts across configuration files - it uses the first configuration found. When running pytest from a subdirectory, the local pytest.ini or pyproject.toml takes precedence over the root config. To ensure --showlocals applies regardless of where pytest is invoked, we add it to each project's configuration: - Root pytest.ini: applies when running from repository root - cuda_core/pytest.ini: applies when running from cuda_core directory - cuda_bindings/pyproject.toml: appended to existing addopts - cuda_pathfinder/pyproject.toml: added new pytest.ini_options section This approach ensures uniform pytest behavior across all projects while maintaining the ability to run tests from any directory.
Contributor
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Contributor
Author
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
rwgk
marked this pull request as ready for review
November 25, 2025 16:03
Contributor
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
mdboom
approved these changes
Dec 1, 2025
Contributor
Author
|
Thanks @mdboom! |
Contributor
|
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.
Add
--showlocalsoption topytestconfigurations across all projects to ensure consistent behavior when displaying local variables in test failures.pytestdoes not mergeaddoptsacross configuration files - it uses the first configuration found. When runningpytestfrom a subdirectory, the localpytest.iniorpyproject.tomltakes precedence over the root config. To ensure--showlocalsapplies regardless of wherepytestis invoked, we add it to each project's configuration:pytest.ini: applies when running from repository rootcuda_core/pytest.ini: applies when running fromcuda_coredirectorycuda_bindings/pyproject.toml: appended to existingaddoptscuda_pathfinder/pyproject.toml: added newpytest.ini_optionssectionThis approach ensures uniform
pytestbehavior across all projects while maintaining the ability to run tests from any directory.Example behavior with
--showlocals: