Skip to content

Commit 0b9222c

Browse files
committed
Fixed PEP8 whitespace issue
1 parent 46b8aac commit 0b9222c

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

pandas/tests/indexes/datetimes/test_ops.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,25 @@ def test_round_ops(self, test_input, rounder, freq, expected):
177177
expect = pd.DatetimeIndex([expected], tz=tz)
178178
tm.assert_index_equal(result, expect)
179179

180+
def test_round_daily(self):
181+
dti = pd.date_range('20130101 09:10:11', periods=5)
182+
result = dti.round('D')
183+
expected = pd.date_range('20130101', periods=5)
184+
tm.assert_index_equal(result, expected)
185+
186+
dti = dti.tz_localize('UTC').tz_convert('US/Eastern')
187+
result = dti.round('D')
188+
expected = pd.date_range('20130101',
189+
periods=5).tz_localize('US/Eastern')
190+
tm.assert_index_equal(result, expected)
191+
192+
result = dti.round('s')
193+
tm.assert_index_equal(result, dti)
194+
195+
# invalid
196+
for freq in ['Y', 'M', 'foobar']:
197+
pytest.raises(ValueError, lambda: dti.round(freq))
198+
180199
def test_round_raises(self):
181200
for tz in self.tz:
182201
rng = pd.date_range(start='2016-01-01', periods=5,

0 commit comments

Comments
 (0)