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
czml tests failing locally because of non-UTC timezones #862
Comments
We just have to paste the output of the command? What exactly we have to do @astrojuanlu |
@priyanshurohilla I bet you are outside of UTC+00 too, right? Therefore, try to run |
Yes I am outside UTC , Ok I would like to work on it!! |
Hi there! First of all, thanks a lot for the work on poliastro. It's a great project than I just started to learn. I'd like to tackle this problem. I've set up the environment and replicated the issue. Two czml unit-tests are failing for me:
I'm in CET timezone (UTC+1), so it fails with an hour difference, exactly the same as reported:
I think the fix should update CZMLExtractor class to always use UTC, rather than local timezone. Still learning about CZML syntax and CZMLExtractor. It looks like the problem is with the initial packet, so the fix will be done most likely in init_czml. Hopefully, I won't need to touch the undelying czml3 package. However, one thing is puzzling. I need to also look at why exactly this timezone problem manifests itself in those two tests, but the other 3 czml tests are working fine. Perhaps I'll write a new test that's trimmed down version of the existing one? Hey @astrojuanlu! Is this the right direction? Also, is it OK to add comments to the tests in the same MR? |
Hey @tomaszmrugalski, looks like you're on the right direction! Yeah please, new comments and tests are always welcome :) |
Also, this library might be helpful https://pypi.org/project/freezegun/ |
I now know why test_czml_add_orbit was "passing". There was an assert missing in line 306. Now it started failing, too. :) Thanks a lot for the tip. Still learning python basics. freezegun looks much more convenient than changing time and timezones of the whole system. |
I confirm that #872 fixed this. Closing! |
This is what happens in UTC+01:
pip freeze
Addresses #<put issue number here>
The text was updated successfully, but these errors were encountered: