@assert_equal.register((datetime.datetime, np.datetime64), (datetime.datetime, np.datetime64))
def assert_timestamp_and_datetime_equal(result, expected, path=(), msg='', allow_datetime_coercions=False, compare_nat_equal=True, **kwargs):
 assert (allow_datetime_coercions or (type(result) == type(expected))), ("%sdatetime types (%s, %s) don't match and allow_datetime_coercions was not set.\n%s" % (_fmt_msg(msg), type(result), type(expected), _fmt_path(path)))
 result = pd.Timestamp(result)
 expected = pd.Timestamp(result)
 if (compare_nat_equal and pd.isnull(result) and pd.isnull(expected)):
  return
 assert_equal.dispatch(object, object)(result, expected, path=path, **kwargs)

@ assert_equal . register ( ( datetime . datetime , np . datetime64 ) , ( datetime . datetime , np . datetime64 ) ) def assert_timestamp_and_datetime_equal ( result , expected , path = ( ) , msg = '' , allow_datetime_coercions = False , compare_nat_equal = True , ** kwargs ) : assert ( allow_datetime_coercions or ( type ( result ) == type ( expected ) ) ) , ( "%sdatetime types (%s, %s) don't match and allow_datetime_coercions was not set.\n%s" % ( _fmt_msg ( msg ) , type ( result ) , type ( expected ) , _fmt_path ( path ) ) ) result = pd . Timestamp ( result ) expected = pd . Timestamp ( result ) if ( compare_nat_equal and pd . isnull ( result ) and pd . isnull ( expected ) ) : return assert_equal . dispatch ( object , object ) ( result , expected , path = path , ** kwargs )
branch for comparing python datetime and np .