diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 6a70ea1df3e71..90dec1a2f3e90 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -11,7 +11,7 @@ echo PYTHONHASHSEED=$PYTHONHASHSEED COVERAGE="-s --cov=pandas --cov-report=xml --cov-append --cov-config=pyproject.toml" # TODO: Support NEP 50 and remove NPY_PROMOTION_STATE -PYTEST_CMD="NPY_PROMOTION_STATE=legacy MESONPY_EDITABLE_VERBOSE=1 PYTHONDEVMODE=1 PYTHONWARNDEFAULTENCODING=1 pytest -r fEs -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET" +PYTEST_CMD="NPY_PROMOTION_STATE=legacy MESONPY_EDITABLE_VERBOSE=1 PYTHONDEVMODE=1 PYTHONWARNDEFAULTENCODING=1 pytest -v --setup-show -r fEs -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET" if [[ "$PATTERN" ]]; then PYTEST_CMD="$PYTEST_CMD -m \"$PATTERN\"" diff --git a/pandas/tests/io/parser/conftest.py b/pandas/tests/io/parser/conftest.py index 471f525e229e5..7aaba40d0d95f 100644 --- a/pandas/tests/io/parser/conftest.py +++ b/pandas/tests/io/parser/conftest.py @@ -134,9 +134,10 @@ def all_parsers(request): pytest.importorskip("pyarrow", VERSIONS["pyarrow"]) # Try finding a way to disable threads all together # for more stable CI runs - import pyarrow + # import pyarrow - pyarrow.set_cpu_count(1) + # pyarrow.set_cpu_count(1) + # pyarrow.set_io_thread_count(1) return parser diff --git a/pandas/tests/io/parser/test_index_col.py b/pandas/tests/io/parser/test_index_col.py index b938b129ac38d..95c0096ae864b 100644 --- a/pandas/tests/io/parser/test_index_col.py +++ b/pandas/tests/io/parser/test_index_col.py @@ -8,6 +8,8 @@ import numpy as np import pytest +from pandas.compat import is_ci_environment + from pandas import ( DataFrame, Index, @@ -94,7 +96,6 @@ def test_infer_index_col(all_parsers): tm.assert_frame_equal(result, expected) -@xfail_pyarrow # CSV parse error: Empty CSV file or block @pytest.mark.parametrize( "index_col,kwargs", [ @@ -134,9 +135,20 @@ def test_infer_index_col(all_parsers): ), ], ) -def test_index_col_empty_data(all_parsers, index_col, kwargs): +def test_index_col_empty_data(all_parsers, index_col, kwargs, request): data = "x,y,z" parser = all_parsers + if parser.engine == "pyarrow": + if is_ci_environment(): + pytest.skip(f"Can hang in CI environment with {parser.engine=}") + else: + mark = pytest.mark.xfail( + reason=( + "CSV parse error: Empty CSV file or block: " + "cannot infer number of columns" + ) + ) + request.applymarker(mark) result = parser.read_csv(StringIO(data), index_col=index_col) expected = DataFrame(**kwargs) diff --git a/pandas/tests/io/parser/test_parse_dates.py b/pandas/tests/io/parser/test_parse_dates.py index 47e654fc606af..6987df4783dda 100644 --- a/pandas/tests/io/parser/test_parse_dates.py +++ b/pandas/tests/io/parser/test_parse_dates.py @@ -19,6 +19,7 @@ from pandas._libs.tslibs import parsing from pandas._libs.tslibs.parsing import py_parse_datetime_string +from pandas.compat import is_ci_environment import pandas as pd from pandas import ( @@ -1752,13 +1753,23 @@ def test_parse_timezone(all_parsers): tm.assert_frame_equal(result, expected) -@xfail_pyarrow # pandas.errors.ParserError: CSV parse error @pytest.mark.parametrize( "date_string", ["32/32/2019", "02/30/2019", "13/13/2019", "13/2019", "a3/11/2018", "10/11/2o17"], ) -def test_invalid_parse_delimited_date(all_parsers, date_string): +def test_invalid_parse_delimited_date(all_parsers, date_string, request): parser = all_parsers + if parser.engine == "pyarrow": + if is_ci_environment(): + pytest.skip(f"Can hang in CI environment with {parser.engine=}") + else: + mark = pytest.mark.xfail( + reason=( + "CSV parse error: Empty CSV file or block: " + "cannot infer number of columns" + ) + ) + request.applymarker(mark) expected = DataFrame({0: [date_string]}, dtype="object") result = parser.read_csv( StringIO(date_string),