def test_parsers_iso8601_invalid_offset_invalid(): date_str = "2001-01-01 12-34-56" msg = ("Timezone hours offset out of range " "in datetime string \"{s}\"".format(s=date_str)) with pytest.raises(ValueError, match=msg): tslib._test_parse_iso8601(date_str)
def test_parsers_iso8601_invalid_offset_invalid(): date_str = "2001-01-01 12-34-56" msg = "Timezone hours offset out of range " 'in datetime string "{s}"'.format( s=date_str) with pytest.raises(ValueError, match=msg): tslib._test_parse_iso8601(date_str)
def test_parsers_iso8601(date_str, exp): # see gh-12060 # # Test only the ISO parser - flexibility to # different separators and leading zero's. actual = tslib._test_parse_iso8601(date_str) assert actual == exp
def test_parsers_iso8601(self, date_str, exp): # GH#12060 # test only the iso parser - flexibility to different # separators and leadings 0s # Timestamp construction falls back to dateutil actual = tslib._test_parse_iso8601(date_str) assert actual == exp
def test_parsers_iso8601_invalid(date_str): msg = "Error parsing datetime string \"{s}\"".format(s=date_str) with pytest.raises(ValueError, match=msg): tslib._test_parse_iso8601(date_str)
def test_parsers_iso8601_leading_space(): # GH#25895 make sure isoparser doesn't overflow with long input date_str, expected = ("2013-1-1 5:30:00", datetime(2013, 1, 1, 5, 30)) actual = tslib._test_parse_iso8601(" " * 200 + date_str) assert actual == expected
def test_parsers_iso8601_invalid(date_str): msg = 'Error parsing datetime string "{s}"'.format(s=date_str) with pytest.raises(ValueError, match=msg): tslib._test_parse_iso8601(date_str)
def test_parsers_iso8601_invalid(self, date_str): # separators must all match - YYYYMM not valid with pytest.raises(ValueError): tslib._test_parse_iso8601(date_str)
def test_parsers_iso8601_leading_space(): # GH#25895 make sure isoparser doesn't overflow with long input date_str, expected = ("2013-1-1 5:30:00", datetime(2013, 1, 1, 5, 30)) actual = tslib._test_parse_iso8601(' ' * 200 + date_str) assert actual == expected