Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix log message printing the number of loaded composites #220

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

pnuu
Copy link
Member

@pnuu pnuu commented Nov 15, 2024

Trollflow2 is printing a log message saying Loading 1 composites even when there are more. This PR fixes the log message.

  • Tests added
  • Tests passed
  • Passes flake8 trollflow2

@pnuu pnuu added the bug Something isn't working label Nov 15, 2024
@pnuu pnuu requested a review from gerritholl November 15, 2024 07:41
@pnuu pnuu self-assigned this Nov 15, 2024
@pnuu pnuu requested a review from mraspaud as a code owner November 15, 2024 07:41
Copy link

codecov bot commented Nov 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.00%. Comparing base (3fd97a4) to head (0169745).
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #220      +/-   ##
==========================================
+ Coverage   95.99%   96.00%   +0.01%     
==========================================
  Files          14       14              
  Lines        3293     3305      +12     
==========================================
+ Hits         3161     3173      +12     
  Misses        132      132              
Flag Coverage Δ
unittests 96.00% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Member

@gerritholl gerritholl left a comment

Choose a reason for hiding this comment

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

Looks good to me, just one small question on caplog in the test.

Comment on lines +847 to +850
@pytest.fixture(autouse=True)
def inject_fixtures(self, caplog):
"""Inject fixtures."""
self._caplog = caplog
Copy link
Member

Choose a reason for hiding this comment

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

What is the benefit of storing a _caplog attribute and using that, rather than using the caplog attribute in the tests directly?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the only way to use fixtures in unittest.TestCase classes.

@pnuu pnuu merged commit a53094f into pytroll:main Feb 28, 2025
9 checks passed
@pnuu pnuu deleted the bugfix-log-message-num-composites branch February 28, 2025 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants