Skip to content

Commit

Permalink
[ArrayManager] TST: include subset of ArrayManager tests in all CI bu…
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche authored Mar 25, 2021
1 parent c8493e3 commit acacff3
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions ci/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,8 @@ fi

echo $PYTEST_CMD
sh -c "$PYTEST_CMD"

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"

echo $PYTEST_AM_CMD
sh -c "$PYTEST_AM_CMD"
10 changes: 10 additions & 0 deletions pandas/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ def pytest_configure(config):
config.addinivalue_line(
"markers", "arm_slow: mark a test as slow for arm64 architecture"
)
config.addinivalue_line(
"markers", "arraymanager: mark a test to run with ArrayManager enabled"
)


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


def pytest_collection_modifyitems(items):
for item in items:
# mark all tests in the pandas/tests/frame directory with "arraymanager"
if "/frame/" in item.nodeid:
item.add_marker(pytest.mark.arraymanager)


# Hypothesis
hypothesis.settings.register_profile(
"ci",
Expand Down
4 changes: 3 additions & 1 deletion pandas/tests/frame/indexing/test_setitem.py
Original file line number Diff line number Diff line change
Expand Up @@ -926,7 +926,9 @@ def test_setitem_duplicate_columns_not_inplace(self):
tm.assert_frame_equal(df_view, df_copy)
tm.assert_frame_equal(df, expected)

@pytest.mark.parametrize("value", [1, np.array([[1], [1]]), [[1], [1]]])
@pytest.mark.parametrize(
"value", [1, np.array([[1], [1]], dtype="int64"), [[1], [1]]]
)
def test_setitem_same_dtype_not_inplace(self, value, using_array_manager, request):
# GH#39510
if not using_array_manager:
Expand Down
3 changes: 2 additions & 1 deletion pandas/tests/frame/test_reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,8 @@ def kurt(x):
pass

# TODO: Ensure warning isn't emitted in the first place
@pytest.mark.filterwarnings("ignore:All-NaN:RuntimeWarning")
# ignore mean of empty slice and all-NaN
@pytest.mark.filterwarnings("ignore::RuntimeWarning")
def test_median(self, float_frame_with_na, int_frame):
def wrapper(x):
if isna(x).any():
Expand Down
2 changes: 1 addition & 1 deletion pandas/tests/frame/test_stack_unstack.py
Original file line number Diff line number Diff line change
Expand Up @@ -905,7 +905,7 @@ def test_unstack_nan_index3(self, using_array_manager):
if using_array_manager:
# INFO(ArrayManager) with ArrayManager preserve dtype where possible
cols = right.columns[[1, 2, 3, 5]]
right[cols] = right[cols].astype("int64")
right[cols] = right[cols].astype(df["C"].dtype)
tm.assert_frame_equal(left, right)

def test_unstack_nan_index4(self):
Expand Down

0 comments on commit acacff3

Please sign in to comment.