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

Bounce window unit tests fail with pytz>=2014.3 #184

Closed
jathanism opened this Issue Jun 10, 2014 · 3 comments

Comments

Projects
None yet
2 participants
@jathanism
Member

jathanism commented Jun 10, 2014

When running unit tests (on Travis-CI for example) and pytz>=2014.3 is installed, the unit tests fail like so:

======================================================================
FAIL: Test lookup of bounce window status.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jathan/sandbox/netplus/trigger/tests/test_changemgmt.py", line 61, in    testStatus
    self.assertEquals(self.pst.status(then), 'green')
AssertionError: <BounceStatus: red> != 'green'

----------------------------------------------------------------------

@jathanism jathanism added the bug label Jun 10, 2014

@jathanism

This comment has been minimized.

Member

jathanism commented Jun 10, 2014

Comparing pytz==2014.2:

>>> from pytz import timezone, UTC
>>> from trigger.changemgmt import BounceStatus, BounceWindow
>>> from datetime import datetime
>>> PST = timezone('US/Pacific')
>>> pst = BounceWindow(green='2-4', yellow='5-7')
>>> then = datetime(2013,6,3, tzinfo=PST)
>>> print then
2013-06-03 00:00:00-08:00
>>> pst.status(then)
<BounceStatus: green>

To pytz==2014.4:

>>> print then
2013-06-03 00:00:00-07:53

Obvserve that the time offset is 7 minutes off. What's up with that? We need to find out.

@jathanism jathanism closed this in ce0f685 Jun 10, 2014

@mvh

This comment has been minimized.

Contributor

mvh commented Jun 10, 2014

See:

http://pytz.sourceforge.net/

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

On Tue, Jun 10, 2014 at 1:46 PM, Jathan McCollum notifications@github.com
wrote:

Comparing pytz==2014.2:

from pytz import timezone, UTC
from trigger.changemgmt import BounceStatus, BounceWindow
from datetime import datetime
PST = timezone('US/Pacific')
pst = BounceWindow(green='2-4', yellow='5-7')
then = datetime(2013,6,3, tzinfo=PST)
print then
2013-06-03 00:00:00-08:00
pst.status(then)
<BounceStatus: green>

To pytz==2014.4:

print then
2013-06-03 00:00:00-07:53

Obvserve that the time offset is 7 minutes off. What's up with that? We
need to find out.


Reply to this email directly or view it on GitHub
#184 (comment).

@jathanism jathanism reopened this Oct 13, 2015

mvh added a commit that referenced this issue Oct 13, 2015

Attempt to fix various time zone issues so that trigger can use the
current version of 'pytz'.  These changes should address
#184.
@jathanism

This comment has been minimized.

Member

jathanism commented Oct 16, 2015

Fixed in #236

@jathanism jathanism closed this Oct 16, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment