Skip to content

Commit

Permalink
Fixed test on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Sylvain MARIE committed Apr 3, 2024
1 parent c88e52d commit 103d9cf
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pandas/tests/scalar/timestamp/test_formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,10 @@ def test_timestamp_repr_strftime_small_year_date(self):
stamp = Timestamp("0002-01-01")
assert repr(stamp) == "Timestamp('2-01-01 00:00:00')"

# Make sure we agree with datetime.strftime
assert datetime(2, 1, 1).strftime("%Y") == "0002"
assert stamp.strftime("%Y") == "0002"
str_tmp, loc_dt_s = convert_strftime_format("%Y", target="datetime")
assert stamp._fast_strftime(str_tmp, loc_dt_s) == "0002"
# Make sure we have zero-padding consistent with python strftime
assert stamp.strftime("%Y-%y") == "0002-02"
str_tmp, loc_dt_s = convert_strftime_format("%Y-%y", target="datetime")
assert stamp._fast_strftime(str_tmp, loc_dt_s) == "0002-02"

def test_timestamp_repr_strftime_negative_date(self):
stamp = Timestamp("-0020-01-01")
Expand Down

0 comments on commit 103d9cf

Please sign in to comment.