def assert_datetime_equal(dt1, dt2, allowance=500):
 assert (abs((dt1 - dt2)) < dt.timedelta(milliseconds=allowance))

def assert_datetime_equal ( dt1 , dt2 , allowance = 500 ) : assert ( abs ( ( dt1 - dt2 ) ) < dt . timedelta ( milliseconds = allowance ) )
assert that two datetimes are about equal .