Skip to content

TST: Add unit tests for evaluate_reduced_mass and remove TODO#1051

Open
Gui-FernandesBR wants to merge 1 commit into
developfrom
tst/add-reduced-mass-tests
Open

TST: Add unit tests for evaluate_reduced_mass and remove TODO#1051
Gui-FernandesBR wants to merge 1 commit into
developfrom
tst/add-reduced-mass-tests

Conversation

@Gui-FernandesBR

Copy link
Copy Markdown
Member

Context

This PR resolves a TODO comment in rocketpy/rocket/rocket.py:615: # TODO: add tests for reduced_mass values.

Modifications Checklist

  • Remove the # TODO: add tests for reduced_mass values comment in rocketpy/rocket/rocket.py.
  • Add three unit tests in tests/unit/rocket/test_rocket.py to cover evaluate_reduced_mass() behavior:
    • test_evaluate_reduced_mass_without_motor: Verifies that calling evaluate_reduced_mass() when the motor is None returns False.
    • test_evaluate_reduced_mass_empty_motor: Verifies that calling evaluate_reduced_mass() when the motor is EmptyMotor returns a Function that evaluates to 0.
    • test_evaluate_reduced_mass_with_motor: Verifies that calling evaluate_reduced_mass() when a motor is associated returns a Function calculating the correct reduced mass.

Expected Outcome

  • The TODO comment is cleared.
  • evaluate_reduced_mass() is fully covered by unit tests.
  • All unit tests pass successfully.

Removes the TODO comment in rocketpy/rocket/rocket.py asking for tests for reduced_mass values. Adds test_evaluate_reduced_mass_without_motor, test_evaluate_reduced_mass_empty_motor, and test_evaluate_reduced_mass_with_motor to tests/unit/rocket/test_rocket.py.
@Gui-FernandesBR Gui-FernandesBR requested a review from a team as a code owner July 5, 2026 15:44
@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.75%. Comparing base (7e37cb0) to head (f313309).
⚠️ Report is 5 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1051      +/-   ##
===========================================
- Coverage    81.75%   81.75%   -0.01%     
===========================================
  Files          119      119              
  Lines        15192    15201       +9     
===========================================
+ Hits         12420    12427       +7     
- Misses        2772     2774       +2     

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

2 participants