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