Skip to content

Add unit tests for planner.py with full coverage - #134

Open
Kavyashah067 wants to merge 1 commit into
brainglobe:mainfrom
Kavyashah067:test-planner-coverage
Open

Add unit tests for planner.py with full coverage#134
Kavyashah067 wants to merge 1 commit into
brainglobe:mainfrom
Kavyashah067:test-planner-coverage

Conversation

@Kavyashah067

Copy link
Copy Markdown
Contributor

Description

What is this PR

  • [✔️] Other
    Full Test Coverage for the planner.py components of brainglobe-heatmap.

Why is this PR needed?
The planner.py module had limited test coverage. Given its role in visualizing slicing planes and interacting with rendering components, it is important to ensure its logic is reliable and well-tested.

What does this PR do?

  • Adds unit tests for planner.py:
    • Initialization with list and dict inputs
    • Calls to print_plane
    • Behavior of show() including interactions with scene and slicer
    • Uses mocking (unittest.mock) to isolate logic from rendering dependencies (brainrender, vedo)

References

Closes Issue #122

How has this PR been tested?

  • All tests pass locally using pytest
  • Achieves 100% coverage for planner.py
  • Rendering-related components are mocked to ensure environment-independent testing

Is this a breaking change?

No

Does this PR require an update to the documentation?

No

Checklist:

  • [✔️] The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • [✔️] The code has been formatted with pre-commit

@codecov

codecov Bot commented Mar 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.42%. Comparing base (d02e7a9) to head (414428f).
⚠️ Report is 16 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #134   +/-   ##
=======================================
  Coverage   87.42%   87.42%           
=======================================
  Files           5        5           
  Lines         326      326           
=======================================
  Hits          285      285           
  Misses         41       41           

☔ View full report in Codecov by Harness.
📢 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.

1 participant