def test_parse_iso8601(string, expected): result = parse_iso8601(string) assert result == expected with pytest.raises(ValueError): parse_iso8601(string + '3') parse_iso8601(string + '.3')