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

Replace patched print with capsys fixture #2929

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

verduijn
Copy link
Contributor

Small change to replace patched print with nicer capsys fixture. Figured I would replace it other tests, turns out there was only one location.

Comment on lines +284 to +285
assert checked_fake, "Did not find __fake package mentioned in checks"
assert checked_viirs_sdr, "Did not find viirs_sdr in readers mentioned in checks"
Copy link
Member

Choose a reason for hiding this comment

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

I don't think these do what are meant to do:

>>> foo = "bar"
>>> assert foo, "bar"
>>> assert foo, "foo"
>>> assert foo == "foo"
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AssertionError

Comment on lines +284 to +285
assert checked_fake, "Did not find __fake package mentioned in checks"
assert checked_viirs_sdr, "Did not find viirs_sdr in readers mentioned in checks"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is working as intended (though i'm following along what was there before).

I /tmp> cat dbg.py 
assert True, "you wont see me"
assert False, "this is a helpful message"
I /tmp> python3 dbg.py 
Traceback (most recent call last):
  File "/tmp/dbg.py", line 2, in <module>
    assert False, "this is a helpful message"
           ^^^^^
AssertionError: this is a helpful message
I /tmp> 

Copy link
Member

Choose a reason for hiding this comment

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

Oh, right. I misunderstood the assertion as I've never seen that before 🙈

Copy link

codecov bot commented Oct 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.07%. Comparing base (044a0ec) to head (7eb17ab).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2929   +/-   ##
=======================================
  Coverage   96.06%   96.07%           
=======================================
  Files         373      373           
  Lines       54477    54479    +2     
=======================================
+ Hits        52336    52338    +2     
  Misses       2141     2141           
Flag Coverage Δ
behaviourtests 3.99% <0.00%> (-0.01%) ⬇️
unittests 96.16% <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.

@coveralls
Copy link

Pull Request Test Coverage Report for Build 11303672980

Details

  • 7 of 7 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 96.166%

Totals Coverage Status
Change from base Build 11298844258: 0.0%
Covered Lines: 52572
Relevant Lines: 54668

💛 - Coveralls

Comment on lines +284 to +285
assert checked_fake, "Did not find __fake package mentioned in checks"
assert checked_viirs_sdr, "Did not find viirs_sdr in readers mentioned in checks"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think this is working as intended (though i'm following along what was there before).

I /tmp> cat dbg.py 
assert True, "you wont see me"
assert False, "this is a helpful message"
I /tmp> python3 dbg.py 
Traceback (most recent call last):
  File "/tmp/dbg.py", line 2, in <module>
    assert False, "this is a helpful message"
           ^^^^^
AssertionError: this is a helpful message
I /tmp> 

Copy link
Member

@pnuu pnuu left a comment

Choose a reason for hiding this comment

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

LGTM, thanks and sorry about the noise!

Comment on lines +284 to +285
assert checked_fake, "Did not find __fake package mentioned in checks"
assert checked_viirs_sdr, "Did not find viirs_sdr in readers mentioned in checks"
Copy link
Member

Choose a reason for hiding this comment

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

Oh, right. I misunderstood the assertion as I've never seen that before 🙈

@mraspaud mraspaud added the enhancement code enhancements, features, improvements label Oct 12, 2024
@mraspaud mraspaud merged commit 2d7f5ed into pytroll:main Oct 12, 2024
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement code enhancements, features, improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants