def test_parse_date_with_invalid_day(): with pytest.raises(ValueError, message="unconverted data remains: 3"): parse_date("20990133")
def test_parse_date(): assert parse_date("20990101") == datetime.date(2099, 1, 1)
def test_parse_date_with_invalid_month(): with pytest.raises(ValueError, message="unconverted data remains: 01"): parse_date("20991401")