|
16 | 16 | import pytz
|
17 | 17 | import pandas as pd
|
18 | 18 | import pandas.io.parsers as parsers
|
19 |
| -import pandas.core.tools.datetimes as tools |
20 | 19 | import pandas.util.testing as tm
|
21 | 20 |
|
22 | 21 | import pandas.io.date_converters as conv
|
@@ -357,21 +356,13 @@ def test_parse_dates_custom_euroformat(self):
|
357 | 356 |
|
358 | 357 | def test_parse_tz_aware(self):
|
359 | 358 | # See gh-1693
|
360 |
| - import pytz |
361 | 359 | data = StringIO("Date,x\n2012-06-13T01:39:00Z,0.5")
|
362 | 360 |
|
363 | 361 | # it works
|
364 | 362 | result = self.read_csv(data, index_col=0, parse_dates=True)
|
365 | 363 | stamp = result.index[0]
|
366 | 364 | assert stamp.minute == 39
|
367 |
| - try: |
368 |
| - assert result.index.tz is pytz.utc |
369 |
| - except AssertionError: |
370 |
| - arr = result.index.to_pydatetime() |
371 |
| - result = tools.to_datetime(arr, utc=True)[0] |
372 |
| - assert stamp.minute == result.minute |
373 |
| - assert stamp.hour == result.hour |
374 |
| - assert stamp.day == result.day |
| 365 | + assert result.index.tz is pytz.utc |
375 | 366 |
|
376 | 367 | def test_multiple_date_cols_index(self):
|
377 | 368 | data = """
|
@@ -677,6 +668,7 @@ def test_parse_date_float(self, data, expected, parse_dates):
|
677 | 668 | tm.assert_frame_equal(result, expected)
|
678 | 669 |
|
679 | 670 | def test_parse_timezone(self):
|
| 671 | + # gh-22256 |
680 | 672 | data = """dt,val
|
681 | 673 | 2018-01-04 09:01:00+09:00,23350
|
682 | 674 | 2018-01-04 09:02:00+09:00,23400
|
|
0 commit comments