This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: test_datetime failing
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: belopolsky, r.david.murray, shanmbic, tim.peters
Priority: normal Keywords:

Created on 2015-10-09 13:31 by shanmbic, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (8)
msg252609 - (view) Author: (shanmbic) * Date: 2015-10-09 13:31
The test for datetime module keeps failing. 

test test_datetime failed -- Traceback (most recent call last):
  File "/home/shantanu/cpython/Lib/test/datetimetester.py", line 215, in test_issue23600
    self.assertEqual(t - t.utcoffset(), u)
AssertionError: datet[22 chars]26, 11, 1, tzinfo=<test.datetimetester.TestTZI[63 chars]538>) != datet[22 chars]26, 12, 1, tzinfo=<test.datetimetester.TestTZI[63 chars]538>)

In datetimetester.py , in function test_issue23600 , line 196:
the variable DSTDIFF has been assigned timedelta of 1 hour, I guess it should be , 

DSTDIFF = timedelta(hours=0)

It passes the test then. 

The comment in the function code says -  
"""Simple time zone which pretends to always be in summer time, since that's what shows the failure.""" Was the test written to fail on purpose ?  

Thanks
msg252617 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-10-09 14:34
No, that delta being one hour is the whole point of that test.

I've nosied Alexander.  He'll probably need more information about the environment in which you are seeing this.
msg252628 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2015-10-09 16:55
@shanmbic - did you recompile C modules before running the tests?
msg252637 - (view) Author: (shanmbic) * Date: 2015-10-09 19:19
@belopolsky - Yeah, I recompiled all the C modules successfully, still it fails the test. I am running Ubuntu 14.10
msg252639 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2015-10-09 19:35
This is just hard to believe.  The symptom you describe is exactly what's expected if you got the new test suite but did not compile the new C code, both added by the fix for:

    http://bugs.python.org/issue23600

Since we have numerous buildbots on which the test passes, what's special about your setup?  The changes here were quite straightforward.  Please double-check.
msg252647 - (view) Author: Alexander Belopolsky (belopolsky) * (Python committer) Date: 2015-10-09 20:27
Maybe @shanmbic has a clock skew and _datetime.so does not get recompiled?

I would try to do make clean or even make distclean and rebuild everything.
msg252648 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2015-10-09 20:28
Yes, I find that if there's something that might be a compilation problem, doing a make distclean and a build from scratch is a good idea to confirm it.
msg252667 - (view) Author: (shanmbic) * Date: 2015-10-09 21:51
make distclean worked. I guess too many reverts in hg caused some issue. :)
History
Date User Action Args
2022-04-11 14:58:22adminsetgithub: 69541
2015-10-09 21:53:05tim.peterssetstatus: open -> closed
resolution: not a bug
components: + Library (Lib), - Extension Modules, ctypes
stage: resolved
2015-10-09 21:51:56shanmbicsetmessages: + msg252667
2015-10-09 20:28:54r.david.murraysetmessages: + msg252648
2015-10-09 20:27:21belopolskysetmessages: + msg252647
2015-10-09 19:35:07tim.peterssetnosy: + tim.peters
messages: + msg252639
2015-10-09 19:19:15shanmbicsetmessages: + msg252637
2015-10-09 16:55:03belopolskysetmessages: + msg252628
2015-10-09 14:34:02r.david.murraysetnosy: + r.david.murray
messages: + msg252617
2015-10-09 13:36:50berker.peksagsetnosy: + belopolsky
2015-10-09 13:31:46shanmbiccreate