Merged
Conversation
tacaswell
approved these changes
Dec 29, 2016
dopplershift
requested changes
Dec 29, 2016
|
|
||
| def test_tz_utc(): | ||
| dt = datetime.datetime(1970, 1, 1, tzinfo=mdates.UTC) | ||
| dt.tzname() |
Contributor
There was a problem hiding this comment.
Why not check the return value of dt.tzname() rather than making this just a smoke test?
Contributor
There was a problem hiding this comment.
I should add that my big complaint here is that this test, while exercising the method, does nothing to actually catch the original problem.
Member
There was a problem hiding this comment.
This does, the exception is coming out of datetime
Python 2.7.13 |Continuum Analytics, Inc.| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>> import matplotlib.dates as mdates
>>> import datetime
>>> dt = datetime.datetime(1970, 1, 1, tzinfo=mdates.UTC)
>>> dt.tzname()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: tzinfo.tzname() must return None or a string, not 'unicode'
>>>
Contributor
There was a problem hiding this comment.
AH. I see now. My mistake.
dopplershift
approved these changes
Dec 29, 2016
Current coverage is 62.07% (diff: 100%)@@ master #7705 diff @@
==========================================
Files 174 174
Lines 56022 56022
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 34776 34777 +1
+ Misses 21246 21245 -1
Partials 0 0
|
tacaswell
added a commit
that referenced
this pull request
Dec 29, 2016
FIX: Fixes tzname return type
Member
|
Thanks! Backported to v2.x as c602d82 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #7630