Skip to content

Commit cd88ee2

Browse files
committed
Add failing test
1 parent 4d3b197 commit cd88ee2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/tests/scalar/timestamp/test_constructors.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,13 @@ def test_construct_with_different_string_format(self, arg):
499499
expected = Timestamp(datetime(2013, 1, 1), tz=pytz.FixedOffset(540))
500500
assert result == expected
501501

502+
@pytest.mark.parametrize(
503+
"arg", ["1-01-01 00:00:00", "3-01-01 00:00:00", "100-01-01 00:00:00"]
504+
)
505+
def test_construct_with_different_string_format_short_year(self, arg):
506+
with pytest.raises(OutOfBoundsDatetime, match=arg):
507+
Timestamp(arg)
508+
502509
def test_construct_timestamp_preserve_original_frequency(self):
503510
# GH 22311
504511
result = Timestamp(Timestamp("2010-08-08", freq="D")).freq

0 commit comments

Comments
 (0)