TST: Refactored Ad GridOperator tests. - #1774
Open
keileg wants to merge 2 commits into
Open
Conversation
Group the tests for subdomain, mortar and boundary projections into one class each, and let them share setup through fixtures and parametrization instead of repeating it. The expected projection matrices are assembled by helper functions that are independent of the implementation under test. The test count grows from 12 to 200, and line coverage of grid_operators.py from 74% to 79%.
The refactored tests build a fresh MortarProjections per case and call each method once, which left the reuse of an already constructed projection matrix uncovered. Assert it directly instead: a repeated call returns the stored matrix, and the integrating and averaging variant of a direction share one matrix exactly when that side of the interface is conforming. Line coverage of grid_operators.py goes from 79% to 82%, above the 74% of the tests this file replaces. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Group the tests for subdomain, mortar and boundary projections into one class each, and let them share setup through fixtures and parametrization instead of repeating it. The expected projection matrices are assembled by helper functions that are independent of the implementation under test.
This PR was extracted from #1747 and must be merged before review of that PR can be finalized.