-
Notifications
You must be signed in to change notification settings - Fork 453
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
Tests fail on days when EST/EDT swap happens #988
Comments
We are running in UTC time and exporting The two doctest tests were fixed by providing |
Freeze the date when performing the tests for format_time() with a timezone specified. Since the time object does not specify a date, the formatter uses the format string specific to the current date. As a result, if the current DST state is different than when the test was last updated, it failed. This fix covers only regular tests. I have no idea how to do the same for doctests. Issue python-babel#988
I've submitted #998 as a partial solution. It freezes the date to get predictable format strings. That said, I've no clue how to do the same for doctests. |
Interestingly, the doctests only fail for me without pytz. |
Ah, maybe that's why I couldn't reproduce it at first — I (wrongly) guessed that we aren't running doctests at all on Gentoo. So perhaps fixing just the main suite will be good enough. |
With #998, tests pass when
The second one has an easy fix, change But just changing the date here (as done in #998) seems just hiding that there is a discrepancy for timezones with pytz vs zoneinfo:
Which one is the correct behaviour? |
https://build.opensuse.org/request/show/1085498 by user dgarcia + dimstar_suse - Add fix-tests.patch to make tests work with EST/EDT swap, gh#python-babel/babel#988 - Update to 2.12.1: * Include py.typed file in wheels by @AlexWaygood in #975 * Become 2.12.1 by @akx in #976 - 2.12.0: * docs(changes): Fix broken issue links by @DenverCoder1 in #922 * Update docs build configuration by @akx in #924 * feat: Adds Format.compact_decimal utility by @DenverCoder1 in #921 * Remove vestigial Python 2 long check by @akx in #925 * feat: Support for short compact currency formats by @DenverCoder1 in #926 * Drop support for EOL Python 3.6 by @akx in #919 * Cast number to Decimal in _get_compact_format by @DenverCoder1 in #930 * Replace %/.format/concatenation with f-strings where feasible by @akx in #927 * ci: Fix testing dependencies by @DenverCoder1 in #9
Overview Description
Timezone related test fails on Babel 1.12.1 around when eastern daylight and eastern standard time swap.
Steps to Reproduce
Actual Results
Expected Results
Tests should likely be frozen in time.
Reproducibility
Around when the daylight saving time goes in and out of effect.
Additional Information
The text was updated successfully, but these errors were encountered: