Skip to content

TST: Refactored Ad GridOperator tests. - #1774

Open
keileg wants to merge 2 commits into
developfrom
refactor_grid_operator_tests
Open

TST: Refactored Ad GridOperator tests.#1774
keileg wants to merge 2 commits into
developfrom
refactor_grid_operator_tests

Conversation

@keileg

@keileg keileg commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant