Example #1
0
def test_timedelta_init_long():
    td = datetime.timedelta(microseconds=20000000000000000000)
    assert td.days == 231481481
    assert td.seconds == 41600
    td = datetime.timedelta(microseconds=20000000000000000000.)
    assert td.days == 231481481
    assert td.seconds == 41600
Example #2
0
def test_attributes():
    for x in [datetime.date.today(),
              datetime.time(),
              datetime.datetime.utcnow(),
              datetime.timedelta(),
              datetime.tzinfo()]:
        raises(AttributeError, 'x.abc = 1')