[Zope-dev] Weird test failures with DateTime

Philipp von Weitershausen philipp at weitershausen.de
Sat Nov 26 06:43:42 EST 2005


Hi,

I've recently been seeing weird DateTime test failures on all Zope 2
branches since 2.7 (see below). Any idea what I'm doing wrong? My system
is OSX 10.3 with a self-compiled Python 2.4.1 (through darwinports). My
system timezone, as you can see, is GMT+0800 (Beijing time).


philipp at bender:~/dev/Zope$ python test.py -s DateTime
Running tests at level 1
Running unit tests:
  Running:
    .

Failure in test testAddPrecision (DateTime.tests.testDateTime.DateTimeTests)
Traceback (most recent call last):
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 260, in run
    testMethod()
  File
"/Users/philipp/dev/Zope/lib/python/DateTime/tests/testDateTime.py",
line 61, in testAddPrecision
    dt)
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 333, in failUnlessEqual
    raise self.failureException, \
AssertionError: 2005/11/26 19:22:40.649 US/Central

......

Failure in test testConstructor5 (DateTime.tests.testDateTime.DateTimeTests)
Traceback (most recent call last):
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 260, in run
    testMethod()
  File
"/Users/philipp/dev/Zope/lib/python/DateTime/tests/testDateTime.py",
line 89, in testConstructor5
    self.assertEqual(str(dt), str(dt1), (dt, dt1))
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 333, in failUnlessEqual
    raise self.failureException, \
AssertionError: (DateTime('2005/11/26 19:22:40.687 US/Central'),
DateTime('2005/11/26 05:22:40.687 US/Central'))

...........

Failure in test testRFC822 (DateTime.tests.testDateTime.DateTimeTests)
Traceback (most recent call last):
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 260, in run
    testMethod()
  File
"/Users/philipp/dev/Zope/lib/python/DateTime/tests/testDateTime.py",
line 328, in testRFC822
    self.assertEqual(dts[5], "%+03d%02d" % divmod( (-offset/60), 60) )
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 333, in failUnlessEqual
    raise self.failureException, \
AssertionError: '-0600' != '+0800'

....

Failure in test testSubtraction (DateTime.tests.testDateTime.DateTimeTests)
Traceback (most recent call last):
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 260, in run
    testMethod()
  File
"/Users/philipp/dev/Zope/lib/python/DateTime/tests/testDateTime.py",
line 138, in testSubtraction
    self.assertEqual(dt1, dt3, (dt, dt1, dt2, dt3))
  File
"/opt/local/Library/Frameworks/Python.framework/Versions/2.4/lib/python2.4/unittest.py",
line 333, in failUnlessEqual
    raise self.failureException, \
AssertionError: (DateTime('2005/11/26 19:23:18.686 US/Central'),
DateTime('2005/11/23 01:59:25.081 US/Central'), DateTime('2005/11/26
19:23:18.686 US/Central'), DateTime('2005/11/23 15:59:25.081 US/Central'))

..........
  Ran 32 tests with 4 failures and 0 errors in 38.183 seconds.



More information about the Zope-Dev mailing list