Skip to content

TST: on_offset_implementations closes #34751 #37376

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 1 commit into from
Oct 24, 2020
Merged
Changes from all 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: 8 additions & 1 deletion pandas/tests/tseries/offsets/test_offsets_properties.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from hypothesis.extra.dateutil import timezones as dateutil_timezones
from hypothesis.extra.pytz import timezones as pytz_timezones
import pytest
import pytz

import pandas as pd
from pandas import Timestamp
Expand Down Expand Up @@ -92,7 +93,13 @@ def test_on_offset_implementations(dt, offset):
# check that the class-specific implementations of is_on_offset match
# the general case definition:
# (dt + offset) - offset == dt
compare = (dt + offset) - offset
try:
compare = (dt + offset) - offset
except pytz.NonExistentTimeError:
# dt + offset does not exist, assume(False) to indicate
# to hypothesis that this is not a valid test case
assume(False)

assert offset.is_on_offset(dt) == (compare == dt)


Expand Down