Skip to content

TST: cln runtime imports in some tests #29560

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 2 commits into from
Nov 12, 2019
Merged
Show file tree
Hide file tree
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
10 changes: 10 additions & 0 deletions pandas/tests/scalar/period/test_period.py
Original file line number Diff line number Diff line change
Expand Up @@ -1044,6 +1044,7 @@ def test_add_sub_nat(self):
assert NaT - p is NaT

p = Period("NaT", freq="M")
assert p is NaT
assert p + NaT is NaT
assert NaT + p is NaT
assert p - NaT is NaT
Expand Down Expand Up @@ -1284,6 +1285,7 @@ def test_add_offset_nat(self):
# freq is DateOffset
for freq in ["A", "2A", "3A"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [offsets.YearEnd(2)]:
assert p + o is NaT
assert o + p is NaT
Expand All @@ -1300,6 +1302,7 @@ def test_add_offset_nat(self):

for freq in ["M", "2M", "3M"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [offsets.MonthEnd(2), offsets.MonthEnd(12)]:
assert p + o is NaT
assert o + p is NaT
Expand All @@ -1317,6 +1320,7 @@ def test_add_offset_nat(self):
# freq is Tick
for freq in ["D", "2D", "3D"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [
offsets.Day(5),
offsets.Hour(24),
Expand All @@ -1340,6 +1344,7 @@ def test_add_offset_nat(self):

for freq in ["H", "2H", "3H"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [
offsets.Day(2),
offsets.Hour(3),
Expand Down Expand Up @@ -1439,6 +1444,7 @@ def test_sub_offset_nat(self):
# freq is DateOffset
for freq in ["A", "2A", "3A"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [offsets.YearEnd(2)]:
assert p - o is NaT

Expand All @@ -1453,6 +1459,7 @@ def test_sub_offset_nat(self):

for freq in ["M", "2M", "3M"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [offsets.MonthEnd(2), offsets.MonthEnd(12)]:
assert p - o is NaT

Expand All @@ -1468,6 +1475,7 @@ def test_sub_offset_nat(self):
# freq is Tick
for freq in ["D", "2D", "3D"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [
offsets.Day(5),
offsets.Hour(24),
Expand All @@ -1489,6 +1497,7 @@ def test_sub_offset_nat(self):

for freq in ["H", "2H", "3H"]:
p = Period("NaT", freq=freq)
assert p is NaT
for o in [
offsets.Day(2),
offsets.Hour(3),
Expand All @@ -1511,6 +1520,7 @@ def test_sub_offset_nat(self):
@pytest.mark.parametrize("freq", ["M", "2M", "3M"])
def test_nat_ops(self, freq):
p = Period("NaT", freq=freq)
assert p is NaT
assert p + 1 is NaT
assert 1 + p is NaT
assert p - 1 is NaT
Expand Down
4 changes: 0 additions & 4 deletions pandas/tests/scalar/timestamp/test_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,6 @@ def test_constructor(self):
base_expected = 1404205200000000000

# confirm base representation is correct
import calendar

assert calendar.timegm(base_dt.timetuple()) * 1000000000 == base_expected

tests = [
Expand Down Expand Up @@ -275,8 +273,6 @@ def test_constructor_with_stringoffset(self):
base_expected = 1404205200000000000

# confirm base representation is correct
import calendar

assert calendar.timegm(base_dt.timetuple()) * 1000000000 == base_expected

tests = [
Expand Down
5 changes: 2 additions & 3 deletions pandas/tests/scalar/timestamp/test_timezones.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,15 +306,14 @@ def test_astimezone(self, tzstr):

@td.skip_if_windows
def test_tz_convert_utc_with_system_utc(self):
from pandas._libs.tslibs.timezones import maybe_get_tz

# from system utc to real utc
ts = Timestamp("2001-01-05 11:56", tz=maybe_get_tz("dateutil/UTC"))
ts = Timestamp("2001-01-05 11:56", tz=timezones.maybe_get_tz("dateutil/UTC"))
# check that the time hasn't changed.
assert ts == ts.tz_convert(dateutil.tz.tzutc())

# from system utc to real utc
ts = Timestamp("2001-01-05 11:56", tz=maybe_get_tz("dateutil/UTC"))
ts = Timestamp("2001-01-05 11:56", tz=timezones.maybe_get_tz("dateutil/UTC"))
# check that the time hasn't changed.
assert ts == ts.tz_convert(dateutil.tz.tzutc())

Expand Down