diff --git a/pandas/tests/arithmetic/test_timedelta64.py b/pandas/tests/arithmetic/test_timedelta64.py index 56f47324967a1..ead9876e7c2a8 100644 --- a/pandas/tests/arithmetic/test_timedelta64.py +++ b/pandas/tests/arithmetic/test_timedelta64.py @@ -1537,7 +1537,8 @@ def test_td64arr_div_nat_invalid(self, box_with_array): rng = timedelta_range('1 days', '10 days', name='foo') rng = tm.box_expected(rng, box_with_array) - with pytest.raises(TypeError, match='true_divide cannot use operands'): + with pytest.raises(TypeError, + match="'?true_divide'? cannot use operands"): rng / pd.NaT with pytest.raises(TypeError, match='Cannot divide NaTType by'): pd.NaT / rng diff --git a/pandas/tests/indexes/timedeltas/test_arithmetic.py b/pandas/tests/indexes/timedeltas/test_arithmetic.py index 08ea69ff98ba1..5ede6a289d42f 100644 --- a/pandas/tests/indexes/timedeltas/test_arithmetic.py +++ b/pandas/tests/indexes/timedeltas/test_arithmetic.py @@ -218,7 +218,7 @@ def test_ops_ndarray(self): expected = pd.to_timedelta(['2 days']).values tm.assert_numpy_array_equal(td * np.array([2]), expected) tm.assert_numpy_array_equal(np.array([2]) * td, expected) - msg = ("ufunc multiply cannot use operands with types" + msg = ("ufunc '?multiply'? cannot use operands with types" r" dtype\('