示例#1
0
def test_timezone_no_sep():
    dt = parse('2018-12-04T19:36:08-0500')
    assert dt.tzinfo
    assert str(dt.tzinfo) == 'UTC-05:00'
示例#2
0
def test_python():
    dt1 = datetime.now().astimezone(timezone.utc)
    dt2 = parse(dt1.isoformat())
    assert dt1 == dt2
示例#3
0
def test_parse_error():
    with pytest.raises(ValueError):
        parse("foo")