Skip to content

Commit acacff3

Browse files
[ArrayManager] TST: include subset of ArrayManager tests in all CI builds (pandas-dev#40496)
1 parent c8493e3 commit acacff3

File tree

5 files changed

+21
-3
lines changed

5 files changed

+21
-3
lines changed

ci/run_tests.sh

+5
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,8 @@ fi
2929

3030
echo $PYTEST_CMD
3131
sh -c "$PYTEST_CMD"
32+
33+
PYTEST_AM_CMD="PANDAS_DATA_MANAGER=array pytest -m \"$PATTERN and arraymanager\" -n $PYTEST_WORKERS --dist=loadfile -s --strict-markers --durations=30 --junitxml=test-data.xml $TEST_ARGS $COVERAGE pandas"
34+
35+
echo $PYTEST_AM_CMD
36+
sh -c "$PYTEST_AM_CMD"

pandas/conftest.py

+10
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ def pytest_configure(config):
8585
config.addinivalue_line(
8686
"markers", "arm_slow: mark a test as slow for arm64 architecture"
8787
)
88+
config.addinivalue_line(
89+
"markers", "arraymanager: mark a test to run with ArrayManager enabled"
90+
)
8891

8992

9093
def pytest_addoption(parser):
@@ -121,6 +124,13 @@ def pytest_runtest_setup(item):
121124
pytest.skip("skipping high memory test since --run-high-memory was not set")
122125

123126

127+
def pytest_collection_modifyitems(items):
128+
for item in items:
129+
# mark all tests in the pandas/tests/frame directory with "arraymanager"
130+
if "/frame/" in item.nodeid:
131+
item.add_marker(pytest.mark.arraymanager)
132+
133+
124134
# Hypothesis
125135
hypothesis.settings.register_profile(
126136
"ci",

pandas/tests/frame/indexing/test_setitem.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,9 @@ def test_setitem_duplicate_columns_not_inplace(self):
926926
tm.assert_frame_equal(df_view, df_copy)
927927
tm.assert_frame_equal(df, expected)
928928

929-
@pytest.mark.parametrize("value", [1, np.array([[1], [1]]), [[1], [1]]])
929+
@pytest.mark.parametrize(
930+
"value", [1, np.array([[1], [1]], dtype="int64"), [[1], [1]]]
931+
)
930932
def test_setitem_same_dtype_not_inplace(self, value, using_array_manager, request):
931933
# GH#39510
932934
if not using_array_manager:

pandas/tests/frame/test_reductions.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,8 @@ def kurt(x):
382382
pass
383383

384384
# TODO: Ensure warning isn't emitted in the first place
385-
@pytest.mark.filterwarnings("ignore:All-NaN:RuntimeWarning")
385+
# ignore mean of empty slice and all-NaN
386+
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
386387
def test_median(self, float_frame_with_na, int_frame):
387388
def wrapper(x):
388389
if isna(x).any():

pandas/tests/frame/test_stack_unstack.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -905,7 +905,7 @@ def test_unstack_nan_index3(self, using_array_manager):
905905
if using_array_manager:
906906
# INFO(ArrayManager) with ArrayManager preserve dtype where possible
907907
cols = right.columns[[1, 2, 3, 5]]
908-
right[cols] = right[cols].astype("int64")
908+
right[cols] = right[cols].astype(df["C"].dtype)
909909
tm.assert_frame_equal(left, right)
910910

911911
def test_unstack_nan_index4(self):

0 commit comments

Comments
 (0)