Skip to content

Add tests for helper functions#63

Open
alexdewar wants to merge 5 commits intomainfrom
add-tests-for-helpers
Open

Add tests for helper functions#63
alexdewar wants to merge 5 commits intomainfrom
add-tests-for-helpers

Conversation

@alexdewar
Copy link
Copy Markdown
Member

Description

There isn't actually a lot of code in this repo (just helper functions to find and call the muse2 binary etc.), but what code we have should be tested -- coverage is currently at 48%.

Add tests for helper functions.

Closes #6.

Copilot AI review requested due to automatic review settings May 8, 2026 08:51
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.23%. Comparing base (d75a1f2) to head (30e8050).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main      #63       +/-   ##
===========================================
+ Coverage   47.61%   95.23%   +47.61%     
===========================================
  Files           3        3               
  Lines          42       42               
  Branches        4        4               
===========================================
+ Hits           20       40       +20     
+ Misses         22        1       -21     
- Partials        0        1        +1     

☔ 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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR increases unit test coverage for the small set of helper utilities in muse2_data_analysis, focusing on locating the muse2 binary, invoking it via subprocess, and ensuring example input/output directories are prepared as expected.

Changes:

  • Add tests for muse2.find_muse2() and muse2.run_muse2() (including success and failure paths).
  • Add tests for helpers.get_example_input_dir() / helpers.get_example_output_dir() behavior when directories exist vs. need generating.
  • Remove the (now unnecessary) tests/__init__.py.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
tests/test_muse2.py Adds unit tests for binary discovery and subprocess invocation wrappers.
tests/test_helpers.py Adds unit tests for example input/output directory helper functions.
tests/__init__.py Removes the tests package marker file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/test_muse2.py


@pytest.fixture(autouse=True)
def reset_muse2_path() -> Generator[None]:
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.

Add unit tests for helper functions

3 participants