Skip to content

Commit ed35aef

Browse files
jbrockmendeljreback
authored andcommitted
Collect datetime64 and PeriodDtype arithmetic tests (#22237)
1 parent 737b329 commit ed35aef

File tree

8 files changed

+2488
-2359
lines changed

8 files changed

+2488
-2359
lines changed

pandas/tests/arithmetic/__init__.py

Whitespace-only changes.

pandas/tests/arithmetic/conftest.py

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# -*- coding: utf-8 -*-
2+
import pytest
3+
4+
import numpy as np
5+
import pandas as pd
6+
7+
8+
@pytest.fixture(params=[1, np.array(1, dtype=np.int64)])
9+
def one(request):
10+
# zero-dim integer array behaves like an integer
11+
return request.param
12+
13+
14+
# ------------------------------------------------------------------
15+
16+
@pytest.fixture(params=[pd.Index, pd.Series, pd.DataFrame],
17+
ids=lambda x: x.__name__)
18+
def box(request):
19+
"""
20+
Several array-like containers that should have effectively identical
21+
behavior with respect to arithmetic operations.
22+
"""
23+
return request.param
24+
25+
26+
@pytest.fixture(params=[
27+
pd.Index,
28+
pd.Series,
29+
pytest.param(pd.DataFrame,
30+
marks=pytest.mark.xfail(reason="Tries to broadcast "
31+
"incorrectly",
32+
strict=True, raises=ValueError))
33+
], ids=lambda x: x.__name__)
34+
def box_df_broadcast_failure(request):
35+
"""
36+
Fixture equivalent to `box` but with the common failing case where
37+
the DataFrame operation tries to broadcast incorrectly.
38+
"""
39+
return request.param

0 commit comments

Comments
 (0)