Skip to content

test: refactor default P2D mesh setup into pytest fixture#5376

Open
swastim01 wants to merge 4 commits intopybamm-team:mainfrom
swastim01:feat/p2d-mesh-fixture
Open

test: refactor default P2D mesh setup into pytest fixture#5376
swastim01 wants to merge 4 commits intopybamm-team:mainfrom
swastim01:feat/p2d-mesh-fixture

Conversation

@swastim01
Copy link
Copy Markdown
Contributor

This PR introduces a pytest fixture for constructing the default P2D mesh and
uses it in a small number of finite volume unit tests to reduce repeated setup.

No test behaviour is changed.

Contributes to #4502

Type of change

Please add a line in the relevant section of CHANGELOG.md to document the change (include PR #)

Important checks:

Please confirm the following before marking the PR as ready for review:

  • No style issues: nox -s pre-commit
  • All tests pass: nox -s tests
  • The documentation builds: nox -s doctests
  • Code is commented for hard-to-understand areas
  • Tests added that prove fix is effective or that feature works

@swastim01 swastim01 requested a review from a team as a code owner February 6, 2026 09:55
Copy link
Copy Markdown
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @swastim01, looks like methods of the name get_p2d_mesh_for_testing are defined in a few more places:

  1. tests/integration/test_spatial_methods/test_spectral_volume.py
  2. tests/unit/test_spatial_methods/test_spectral_volume.py
  3. in tests/shared.py – used twice in tests/integration/test_spatial_methods/test_finite_volume.py (this was probably missed)

I'm happy to approve this once these references are handled!

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 98.29%. Comparing base (86531fb) to head (43fbdf4).
⚠️ Report is 6 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5376   +/-   ##
=======================================
  Coverage   98.29%   98.29%           
=======================================
  Files         328      328           
  Lines       28941    28941           
=======================================
  Hits        28449    28449           
  Misses        492      492           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

2 participants