-
Notifications
You must be signed in to change notification settings - Fork 6
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
ENH: Add conditional to adapt behaviour depending on astropy version and warn user #73
Conversation
Codecov Report
@@ Coverage Diff @@
## master #73 +/- ##
==========================================
+ Coverage 47.88% 48.21% +0.32%
==========================================
Files 19 19
Lines 3621 3646 +25
==========================================
+ Hits 1734 1758 +24
- Misses 1887 1888 +1
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you for continuing this work !
I made a couple suggestions to improve the tests, but in general I'm in favour of this simply superseding my own PR, so I'll close #60
Another important thing is that we should test this properly using the pre release. I'll open a PR to do just that |
Thanks @neutrinoceros ! For the first suggestion, I kept the two tests for now. I'm not opposed to removing the "drops" one. I have little experience with unit tests, so I'd let you decide what to do here. My initial idea was to test the behaviour because there is a warning related to it, so if the behaviour is fixed, a failing test would flag that the warning needs to be removed. |
It's a good idea. In general, it's good to test failing cases, not just successes. Another rule of thumb is to avoid testing implementation details instead of behaviour, because it tends to rigidify the design, and it's a burden to maintain. So ideally here we should have:
|
we're getting there, thank you for your patience @vandalt ! |
Thanks for your detailed comments @neutrinoceros ! I think I addressed all of them, but let me know if I forgot something or if there are others. EDIT: Typo |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this should be my final round of review. I apologies for misleading you into combining xfail
and skipif
, I realised while reading this that we should probably never have to use more than one.
It'd be useful to run the "bleeding edge" job I just merged into master here, to check that your tests behave correctly with astropy's dev version. |
for more information, see https://pre-commit.ci
Co-authored-by: Clément Robert <cr52@protonmail.com>
I rebased on master and also rebased the master of my fork on master. I'm not sure how to run the "bleeding edge" CI though. I did run pytest in a virtualenv with the |
Thanks, I had just figured out how to launch it, so it's running. However, all previous CI runs on my fork failed with the following error in the "Upload coverage to codecov" section:
Does it mean I need to setup codecov on the fork ? |
No you don't. Actually you could deactivate actions on your fork in general, it's not necessary. |
so the job is here https://github.com/vandalt/AMICAL/runs/4094406054?check_suite_focus=true |
I confirm that the results are consistent with running locally with the release candidate. Hurray ! |
reason="Munch cannot handle commentary cards for Astropy < 5.0", | ||
) | ||
def test_commentary_infos_keep(commentary_infos): | ||
assert "HISTORY" in commentary_infos.hdr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not understand why Codecov reports this as not hit. It runs on my machine whatever version of astropy I use. Any clue ? (not needed to get this merged)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No sorry... Works on my machine as well, and I don't know much about Codecov
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alright, thanks again for your patience, I think this is mergeable now. I'll give you the opportunity to respond to my last suggestions and after that I'll push the button :-)
Co-authored-by: Clément Robert <cr52@protonmail.com>
for more information, see https://pre-commit.ci
Thanks for the help on this @neutrinoceros. Sorry I was away today, so your last suggestion was accepted via mobile and the commit message is not very informative. |
This is a follow-up for #60 by @neutrinoceros. As discussed there, I added a warning that commentary cards are removed. I also changed
working version
to5.0rc1
, the first release candidate with the upstream fix included. I also added tests to 1) check that the card is included in 5.0 and 2) Check that the warning is issued before 5.0.