Skip to content

Commit 0d6efa0

Browse files
TST: test_replace.py now explicitly check the Timestamp.unit
1 parent 5a62136 commit 0d6efa0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/tests/scalar/timestamp/methods/test_replace.py

+4
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ def test_replace_unit(self):
195195
ts = Timestamp("2023-07-15 23:08:12")
196196
ts1 = Timestamp("2023-07-15 23:08:12.134567")
197197
ts2 = Timestamp("2023-07-15 23:08:12.134567123")
198+
ts = ts.replace(microsecond=999)
199+
assert ts.unit == "ms"
198200
ts = ts.replace(microsecond=ts1.microsecond)
201+
assert ts.unit == "us"
199202
assert ts == ts1
200203
ts = ts.replace(nanosecond=ts2.nanosecond)
204+
assert ts.unit == "ns"
201205
assert ts == ts2

0 commit comments

Comments
 (0)