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

Tests failure with newer pytz versions #133

Closed
benselme opened this issue Jan 8, 2015 · 1 comment
Closed

Tests failure with newer pytz versions #133

benselme opened this issue Jan 8, 2015 · 1 comment

Comments

@benselme
Copy link
Member

benselme commented Jan 8, 2015

Three tests fail with versions of pytz>=2014.4

From the pytz docs:

Unfortunately using the tzinfo argument of the standard datetime constructors
‘’does not work’’ with pytz for many timezones.

So I think that the way those tests are written is broken.

=================================== FAILURES ====================================
___________________ DateTimeFormatTestCase.test_timezone_gmt ____________________

self = <tests.test_dates.DateTimeFormatTestCase testMethod=test_timezone_gmt>

def test_timezone_gmt(self):
    tz = timezone('Europe/Berlin')
    t = time(15, 30, tzinfo=tz)
    fmt = dates.DateTimeFormat(t, locale='de_DE')
>       self.assertEqual('GMT+01:00', fmt['ZZZZ'])
E       AssertionError: 'GMT+01:00' != 'GMT+00:53'
E       - GMT+01:00
E       + GMT+00:53

tests/test_dates.py:188: AssertionError
__________________ DateTimeFormatTestCase.test_timezone_rfc822 __________________

self = <tests.test_dates.DateTimeFormatTestCase testMethod=test_timezone_rfc822>

def test_timezone_rfc822(self):
    tz = timezone('Europe/Berlin')
    t = time(15, 30, tzinfo=tz)
    fmt = dates.DateTimeFormat(t, locale='de_DE')
>       self.assertEqual('+0100', fmt['Z'])
E       AssertionError: '+0100' != '+0053'
E       - +0100
E       + +0053

tests/test_dates.py:182: AssertionError
_____________________________ test_get_timezone_gmt _____________________________

def test_get_timezone_gmt():
    dt = datetime(2007, 4, 1, 15, 30)
    assert dates.get_timezone_gmt(dt, locale='en') == u'GMT+00:00'

    tz = timezone('America/Los_Angeles')
    dt = datetime(2007, 4, 1, 15, 30, tzinfo=tz)
>       assert dates.get_timezone_gmt(dt, locale='en') == u'GMT-08:00'
E       assert 'GMT-08:07' == 'GMT-08:00'
E         - GMT-08:07
E         ?         ^
E         + GMT-08:00
E         ?         ^

tests/test_dates.py:384: AssertionError
benselme added a commit to benselme/babel that referenced this issue Jan 8, 2015
@benselme
Copy link
Member Author

benselme commented Jan 8, 2015

Dupe of #106

@benselme benselme closed this as completed Jan 8, 2015
st4lk added a commit to st4lk/babel that referenced this issue Jan 26, 2015
pld-gitsync pushed a commit to pld-linux/python-babel that referenced this issue Nov 30, 2015
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 a pull request may close this issue.

1 participant