Edgewall Software

Ticket #83 (closed defect: fixed)

Opened 11 months ago

Last modified 7 months ago

unittest failing on time

Reported by: jruigrok Owned by: cmlenz
Priority: critical Milestone: 0.9.3
Component: Date Formatting Version: 0.9.2
Keywords: Cc:

Description

The following two might most likely fail due to summer/winter time differences.

FAIL: format_time (babel.dates)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.5/doctest.py", line 2112, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for babel.dates.format_time
  File "/usr/home/asmodai/projects/babel/babel/dates.py", line 504, in format_time

----------------------------------------------------------------------
File "/usr/home/asmodai/projects/babel/babel/dates.py", line 524, in babel.dates.format_time
Failed example:
    format_time(t, format='full', tzinfo=timezone('Europe/Paris'),
                locale='fr_FR')
Expected:
    u'17:30:00 HEC'
Got:
    u'16:30:00 HEC'
----------------------------------------------------------------------
File "/usr/home/asmodai/projects/babel/babel/dates.py", line 527, in babel.dates.format_time
Failed example:
    format_time(t, "hh 'o''clock' a, zzzz", tzinfo=timezone('US/Eastern'),
                locale='en')
Expected:
    u"11 o'clock AM, Eastern Daylight Time"
Got:
    u"10 o'clock AM, Eastern Standard Time"
FAIL: time (babel.support.Format)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.5/doctest.py", line 2112, in runTest
    raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for babel.support.Format.time
  File "/usr/home/asmodai/projects/babel/babel/support.py", line 77, in time

----------------------------------------------------------------------
File "/usr/home/asmodai/projects/babel/babel/support.py", line 82, in babel.support.Format.time
Failed example:
    fmt.time(time(15, 30))
Expected:
    u'11:30:00 AM'
Got:
    u'10:30:00 AM'

Attachments

Change History

Changed 7 months ago by cmlenz

  • priority changed from minor to critical
  • component changed from General to Date Formatting
  • milestone changed from 1.0 to 0.9.3

This was worked around in [360] by simply using UTC, but as the test failure points to a deeper problem with DST-aware time formatting in Babel, I'm looking into a proper fix now.

Changed 7 months ago by cmlenz

  • status changed from new to closed
  • resolution set to fixed

Okay, I think this should be properly fixed in [385].

Add/Change #83 (unittest failing on time)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.