Skip to content

Commit bb94e72

Browse files
authored
COMPAT: dont pass dtype to datetime64 (#31411)
1 parent b1214af commit bb94e72

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/tests/scalar/timedelta/test_arithmetic.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ def test_td_rfloordiv_invalid_scalar(self):
498498
# GH#18846
499499
td = Timedelta(hours=3, minutes=3)
500500

501-
dt64 = np.datetime64("2016-01-01", dtype="datetime64[us]")
501+
dt64 = np.datetime64("2016-01-01", "us")
502502
with pytest.raises(TypeError):
503503
td.__rfloordiv__(dt64)
504504

pandas/tests/scalar/timestamp/test_timestamp.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -565,15 +565,15 @@ def test_bounds_with_different_units(self):
565565

566566
for date_string in out_of_bounds_dates:
567567
for unit in time_units:
568-
dt64 = np.datetime64(date_string, dtype="M8[{unit}]".format(unit=unit))
568+
dt64 = np.datetime64(date_string, unit)
569569
with pytest.raises(ValueError):
570570
Timestamp(dt64)
571571

572572
in_bounds_dates = ("1677-09-23", "2262-04-11")
573573

574574
for date_string in in_bounds_dates:
575575
for unit in time_units:
576-
dt64 = np.datetime64(date_string, dtype="M8[{unit}]".format(unit=unit))
576+
dt64 = np.datetime64(date_string, unit)
577577
Timestamp(dt64)
578578

579579
def test_min_valid(self):

0 commit comments

Comments
 (0)