Skip to content

Commit 52aa9b4

Browse files
committed
CLN: Remove try-except in parse_dates test
- Resolves #22422
1 parent a54be89 commit 52aa9b4

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

pandas/tests/io/parser/parse_dates.py

+1-10
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import pytz
1717
import pandas as pd
1818
import pandas.io.parsers as parsers
19-
import pandas.core.tools.datetimes as tools
2019
import pandas.util.testing as tm
2120

2221
import pandas.io.date_converters as conv
@@ -357,21 +356,13 @@ def test_parse_dates_custom_euroformat(self):
357356

358357
def test_parse_tz_aware(self):
359358
# See gh-1693
360-
import pytz
361359
data = StringIO("Date,x\n2012-06-13T01:39:00Z,0.5")
362360

363361
# it works
364362
result = self.read_csv(data, index_col=0, parse_dates=True)
365363
stamp = result.index[0]
366364
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
375366

376367
def test_multiple_date_cols_index(self):
377368
data = """

0 commit comments

Comments
 (0)