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

Fixes serializer tests failing locally in Ginkgo #414

Merged
merged 2 commits into from
Jan 26, 2022

Conversation

johnbaldwin
Copy link
Contributor

  • The version 2.4.2 dateutil.parser.parse method returns a datetime
    object in local time, causing the tests to fail when compared against
    datetime in UTC
  • This commit addresses the issue by replacing the timezone with UTC
  • This commit includes a helper function, as_datetime_utc in tests/test_serializers.py
  • Read the docstring for this helper function

* The version 2.4.2 `dateutil.parser.parse` method returns a `datetime`
object in local time, causing the tests to fail when compared against
datetime in UTC
* This commit addresses the issue by replacing the timezone with UTC
* This commit includes a helper function, `as_datetime_utc` in tests/test_serializers.py
* Read the docstring for this helper function
Copy link
Contributor

@bryanlandia bryanlandia left a comment

Choose a reason for hiding this comment

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

Makes sense, but would this function be better put into a test utils module rather than just in this specific serializers test module?

https://github.com/appsembler/figures/search?q=dateutil.parser

shows a lot of files using a dateutil_parse. Maybe at least put this func in test_helpers.py

I'll approve but please consider

@johnbaldwin
Copy link
Contributor Author

@bryanlandia I updated per your request

@johnbaldwin johnbaldwin merged commit 596df83 into master Jan 26, 2022
@johnbaldwin johnbaldwin deleted the john/ginkgo-fix-serializer-tests branch January 26, 2022 19:11
@bryanlandia
Copy link
Contributor

Thanks @johnbaldwin Looks like as_datetime_utc could probably be used here too

the_date = dateutil_parse(the_date_str).date()

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.

3 participants