Skip to content
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
10 changes: 7 additions & 3 deletions pandas/tests/scalar/timestamp/test_timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def test_asm8(self):

def test_class_ops_pytz(self):
def compare(x, y):
assert int(Timestamp(x).value / 1e9) == int(Timestamp(y).value / 1e9)
assert int((Timestamp(x).value - Timestamp(y).value) / 1e9) == 0

compare(Timestamp.now(), datetime.now())
compare(Timestamp.now("UTC"), datetime.now(timezone("UTC")))
Expand All @@ -775,8 +775,12 @@ def compare(x, y):

def test_class_ops_dateutil(self):
def compare(x, y):
assert int(np.round(Timestamp(x).value / 1e9)) == int(
np.round(Timestamp(y).value / 1e9)
assert (
int(
np.round(Timestamp(x).value / 1e9)
- np.round(Timestamp(y).value / 1e9)
)
== 0
)

compare(Timestamp.now(), datetime.now())
Expand Down