{"action":"closed","issue":{"url":"https://api.github.com/repos/mithro/python-datetime-tz/issues/9","labels_url":"https://api.github.com/repos/mithro/python-datetime-tz/issues/9/labels{/name}","comments_url":"https://api.github.com/repos/mithro/python-datetime-tz/issues/9/comments","events_url":"https://api.github.com/repos/mithro/python-datetime-tz/issues/9/events","html_url":"https://github.com/mithro/python-datetime-tz/issues/9","id":90098865,"number":9,"title":"`testCreation` will fail on the first Sunday of October from 02:00 local time for 1 hour","user":{"login":"micolous","id":246847,"avatar_url":"https://avatars.githubusercontent.com/u/246847?v=3","gravatar_id":"","url":"https://api.github.com/users/micolous","html_url":"https://github.com/micolous","followers_url":"https://api.github.com/users/micolous/followers","following_url":"https://api.github.com/users/micolous/following{/other_user}","gists_url":"https://api.github.com/users/micolous/gists{/gist_id}","starred_url":"https://api.github.com/users/micolous/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micolous/subscriptions","organizations_url":"https://api.github.com/users/micolous/orgs","repos_url":"https://api.github.com/users/micolous/repos","events_url":"https://api.github.com/users/micolous/events{/privacy}","received_events_url":"https://api.github.com/users/micolous/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-06-22T13:32:50Z","updated_at":"2015-06-29T06:08:25Z","closed_at":"2015-06-29T06:08:25Z","body":"https://github.com/mithro/python-datetime-tz/blob/master/tests.py#L337\r\n\r\nThis test uses `datetime.datetime.now()` in order to populate a time value.  On the first Sunday of October each year, between 02:00:00 and 02:59:59 local time (not Sydney time), this test will fail with an error:\r\n\r\n```\r\n======================================================================\r\nFAIL: testCreation (__main__.TestDatetimeTZ)\r\n----------------------------------------------------------------------\r\nTraceback (most recent call last):\r\n  File \"tests.py\", line 342, in testCreation\r\n    self.assertEqual(d4.tzinfo, d5.tzinfo)\r\nAssertionError: <DstTzInfo 'Australia/Sydney' EST+10:00:00 STD> != <DstTzInfo 'Australia/Sydney' EST+11:00:00 DST>\r\n\r\n----------------------------------------------------------------------\r\n```\r\n\r\nIt looks like the library and pytz are making different assumptions about how to handle ambiguous times.  The function itself is dangerous (as is anything that depends on \"now\") because the tests are no longer deterministic.\r\n\r\nThis test won't ever fail for systems with the same DST transition time as Sydney, as `datetime.datetime.now()` will never return the ambiguous time value.  This means the test will fail if local time is set to Brisbane, Darwin or Perth time (no DST), but never fail if it is set to Adelaide, Hobart, Melbourne or Sydney time."}}