Пример #1
0
def test_datetime(args, kwargs):
    act = rdt.make_datetime(*args, **kwargs)
    exp = pdt.datetime(*args, **kwargs)

    assert act == exp
    assert act.tzinfo is exp.tzinfo
    assert rdt.get_datetime_tzinfo(act) == exp.tzinfo
Пример #2
0
def test_datetime_typeerror():
    with pytest.raises(TypeError):
        rdt.make_datetime("2011", 1, 1, 0, 0, 0, 0)
Пример #3
0
def test_invalid_datetime_fails():
    with pytest.raises(ValueError):
        rdt.make_datetime(2011, 1, 42, 0, 0, 0, 0)