Skip to content

Commit 2cf0756

Browse files
author
MomIsBestFriend
committed
Moved the test case
REF: #31538 (comment)
1 parent 5691066 commit 2cf0756

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

pandas/tests/arithmetic/test_datetime64.py

+14
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,20 @@ def test_dt64arr_add_sub_parr(
10561056
)
10571057
assert_invalid_addsub_type(dtarr, parr, msg)
10581058

1059+
def test_timestamp_and_time_dtype_raises():
1060+
# https://github.com/pandas-dev/pandas/issues/10329
1061+
df = pd.DataFrame(
1062+
{
1063+
"date": pd.date_range("2012-01-01", periods=3),
1064+
"time": [time(i, i, i) for i in range(3)],
1065+
}
1066+
)
1067+
1068+
msg = r"unsupported operand type\(s\) for -: 'Timestamp' and 'datetime.time'"
1069+
1070+
with pytest.raises(TypeError, match=msg):
1071+
df["date"] - df["time"]
1072+
10591073

10601074
class TestDatetime64DateOffsetArithmetic:
10611075

pandas/tests/frame/test_timeseries.py

-15
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,6 @@
2121
import pandas.tseries.offsets as offsets
2222

2323

24-
def test_timestamp_and_time_dtype_raises():
25-
# https://github.com/pandas-dev/pandas/issues/10329
26-
df = pd.DataFrame(
27-
{
28-
"date": pd.date_range("2012-01-01", periods=3),
29-
"time": [time(i, i, i) for i in range(3)],
30-
}
31-
)
32-
33-
msg = r"unsupported operand type\(s\) for -: 'Timestamp' and 'datetime.time'"
34-
35-
with pytest.raises(TypeError, match=msg):
36-
df["date"] - df["time"]
37-
38-
3924
@pytest.fixture(params=product([True, False], [True, False]))
4025
def close_open_fixture(request):
4126
return request.param

0 commit comments

Comments
 (0)