Skip to content

Test for #16726. unittest that ensures datetime is understood #16744

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

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pandas/tests/series/test_datetime_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,3 +409,12 @@ def test_date_tz(self):
date(2015, 11, 22)])
assert_series_equal(s.dt.date, expected)
assert_series_equal(s.apply(lambda x: x.date()), expected)

def test_datetime_understood(self):
# Ensures it doesn't fail to create the right series reported in issue#16726
result = pd.Series(pd.date_range("2012-01-01", periods=3)) - pd.offsets.DateOffset(days=6)
expected = pd.Series(pd.to_datetime(['2011-12-26', '2011-12-27', '2011-12-28']))
tm.assert_series_equal(result, expected)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These blank lines at the end caused the linting error https://travis-ci.org/pandas-dev/pandas/jobs/245637992#L1393

Looks like some lines are too long as well. You can test this locally with flake8 pandas/tests/series/tests_datetime_values.py (might have to install flake8 first)`

Seems like the test passed though, so the style stuff should be the only change, then we can get this merged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done. Thanks.