def test_rfc3339_parse_date_none(): with pytest.raises(ValueError): rfc3339.parse_date(None) assert Rfc3339(propagate_none=True).parse_date(None) is None
def test_rfc3339_parse_date_invalid(date): with pytest.raises(ValueError): rfc3339.parse_date(date)
def test_rfc3339_parse_date(): assert rfc3339.parse_date("2011-12-13") == date(2011, 12, 13) # `datetime.strptime` does not require leading zeros for month, day, hour, minutes, seconds assert rfc3339.parse_date("0001-2-3") == date(1, 2, 3)