diff --git a/.circleci/config.yml b/.circleci/config.yml index dc357101e79fd..1beadf94dbc49 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -8,7 +8,7 @@ jobs: environment: ENV_FILE: ci/deps/circle-38-arm64.yaml PYTEST_WORKERS: auto - PATTERN: "not slow and not network and not clipboard and not arm_slow" + PATTERN: "not slow and not network and not clipboard and not arm_slow and not single" PYTEST_TARGET: "pandas" steps: - checkout diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 6da47c86026ed..a283c2b68625a 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -15,7 +15,7 @@ on: env: PYTEST_WORKERS: "auto" PANDAS_CI: 1 - PATTERN: ((not slow and not network and not clipboard) or (single and db)) + PATTERN: db COVERAGE: true jobs: diff --git a/.github/workflows/posix.yml b/.github/workflows/posix.yml index f37f31686ef69..70df155ff7ff7 100644 --- a/.github/workflows/posix.yml +++ b/.github/workflows/posix.yml @@ -13,7 +13,6 @@ on: - "doc/**" env: - PYTEST_WORKERS: "auto" PANDAS_CI: 1 jobs: @@ -25,14 +24,16 @@ jobs: strategy: matrix: settings: [ - [actions-38-minimum_versions.yaml, "not slow and not network and not clipboard", "", "", "", "", ""], - [actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", ""], - [actions-38.yaml, "not slow and not network and not clipboard", "", "", "", "", ""], - [actions-38-slow.yaml, "slow", "", "", "", "", ""], - [actions-38-locale.yaml, "not slow and not network", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", ""], - [actions-39-slow.yaml, "slow", "", "", "", "", ""], - [actions-39-numpydev.yaml, "not slow and not network", "xsel", "", "", "deprecate", "-W error"], - [actions-39.yaml, "not slow and not network and not clipboard", "", "", "", "", ""] + [actions-38-minimum_versions.yaml, "not slow and not network and not clipboard and not single", "", "", "", "", "", "auto"], + [actions-38-locale_slow.yaml, "slow", "language-pack-it xsel", "it_IT.utf8", "it_IT.utf8", "", "", "auto"], + [actions-38.yaml, "not slow and not network and not clipboard and not single", "", "", "", "", "", "auto"], + [actions-38-slow-single.yaml, "slow", "", "", "", "", "", "auto"], + [actions-38-slow-single.yaml, "single", "", "", "", "", "", "1"], + [actions-38-locale.yaml, "not slow and not network and not single", "language-pack-zh-hans xsel", "zh_CN.utf8", "zh_CN.utf8", "", "", "auto"], + [actions-39-slow-single.yaml, "slow", "", "", "", "", "", "auto"], + [actions-39-slow-single.yaml, "single", "", "", "", "", "", "1"], + [actions-39-numpydev.yaml, "not slow and not network and not single", "xsel", "", "", "deprecate", "-W error", "auto"], + [actions-39.yaml, "not slow and not network and not clipboard and not single", "", "", "", "", "", "auto"] ] fail-fast: false env: @@ -44,6 +45,7 @@ jobs: LC_ALL: ${{ matrix.settings[4] }} PANDAS_TESTING_MODE: ${{ matrix.settings[5] }} TEST_ARGS: ${{ matrix.settings[6] }} + PYTEST_WORKERS: ${{ matrix.settings[7] }} PYTEST_TARGET: pandas concurrency: group: ${{ github.ref }}-${{ matrix.settings[0] }} diff --git a/ci/azure/posix.yml b/ci/azure/posix.yml index eaac17d50c315..1f8ed607b3a75 100644 --- a/ci/azure/posix.yml +++ b/ci/azure/posix.yml @@ -9,15 +9,20 @@ jobs: strategy: matrix: ${{ if eq(parameters.name, 'macOS') }}: + py38_macos_single: + ENV_FILE: ci/deps/azure-macos-38.yaml + CONDA_PY: "38" + PATTERN: "single" + PYTEST_WORKERS: 1 py38_macos_1: ENV_FILE: ci/deps/azure-macos-38.yaml CONDA_PY: "38" - PATTERN: "not slow and not network" + PATTERN: "not slow and not network and not single" PYTEST_TARGET: "pandas/tests/[a-h]*" py38_macos_2: ENV_FILE: ci/deps/azure-macos-38.yaml CONDA_PY: "38" - PATTERN: "not slow and not network" + PATTERN: "not slow and not network and not single" PYTEST_TARGET: "pandas/tests/[i-z]*" steps: diff --git a/ci/azure/windows.yml b/ci/azure/windows.yml index 3bd20b1399be2..a1695698821bf 100644 --- a/ci/azure/windows.yml +++ b/ci/azure/windows.yml @@ -8,31 +8,43 @@ jobs: vmImage: ${{ parameters.vmImage }} strategy: matrix: + py38_np18_single: + ENV_FILE: ci/deps/azure-windows-38.yaml + CONDA_PY: "38" + PATTERN: "single" + PYTEST_WORKERS: 1 + + py39_single: + ENV_FILE: ci/deps/azure-windows-39.yaml + CONDA_PY: "39" + PATTERN: "single" + PYTEST_WORKERS: 1 + py38_np18_1: ENV_FILE: ci/deps/azure-windows-38.yaml CONDA_PY: "38" - PATTERN: "not slow and not network" + PATTERN: "not slow and not network and not single" PYTEST_WORKERS: 2 # GH-42236 PYTEST_TARGET: "pandas/tests/[a-h]*" py38_np18_2: ENV_FILE: ci/deps/azure-windows-38.yaml CONDA_PY: "38" - PATTERN: "not slow and not network" + PATTERN: "not slow and not network and not single" PYTEST_WORKERS: 2 # GH-42236 PYTEST_TARGET: "pandas/tests/[i-z]*" py39_1: ENV_FILE: ci/deps/azure-windows-39.yaml CONDA_PY: "39" - PATTERN: "not slow and not network and not high_memory" + PATTERN: "not slow and not network and not single" PYTEST_WORKERS: 2 # GH-42236 PYTEST_TARGET: "pandas/tests/[a-h]*" py39_2: ENV_FILE: ci/deps/azure-windows-39.yaml CONDA_PY: "39" - PATTERN: "not slow and not network and not high_memory" + PATTERN: "not slow and not network and not single" PYTEST_WORKERS: 2 # GH-42236 PYTEST_TARGET: "pandas/tests/[i-z]*" diff --git a/ci/deps/actions-38-slow.yaml b/ci/deps/actions-38-slow-single.yaml similarity index 100% rename from ci/deps/actions-38-slow.yaml rename to ci/deps/actions-38-slow-single.yaml diff --git a/ci/deps/actions-39-slow.yaml b/ci/deps/actions-39-slow-single.yaml similarity index 100% rename from ci/deps/actions-39-slow.yaml rename to ci/deps/actions-39-slow-single.yaml diff --git a/ci/run_tests.sh b/ci/run_tests.sh index 9fea696b6ea81..6a728fdece6f8 100755 --- a/ci/run_tests.sh +++ b/ci/run_tests.sh @@ -19,7 +19,7 @@ if [[ $(uname) == "Linux" && -z $DISPLAY ]]; then XVFB="xvfb-run " fi -PYTEST_CMD="${XVFB}pytest -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET" +PYTEST_CMD="${XVFB}pytest -v -m \"$PATTERN\" -n $PYTEST_WORKERS --dist=loadfile $TEST_ARGS $COVERAGE $PYTEST_TARGET" if [[ $(uname) != "Linux" && $(uname) != "Darwin" ]]; then PYTEST_CMD="$PYTEST_CMD --ignore=pandas/tests/plotting/" diff --git a/pandas/conftest.py b/pandas/conftest.py index 04589993b5f53..aaf82d4e8334e 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -98,7 +98,6 @@ def pytest_collection_modifyitems(items, config): only_slow = config.getoption("--only-slow") skip_network = config.getoption("--skip-network") skip_db = config.getoption("--skip-db") - run_high_memory = config.getoption("--run-high-memory") marks = [ (pytest.mark.slow, "slow", skip_slow, "--skip-slow"), @@ -125,13 +124,6 @@ def pytest_collection_modifyitems(items, config): if only_slow and "slow" not in item.keywords: item.add_marker(pytest.mark.skip("skipping due to --only-slow")) - if "high_memory" in item.keywords and not run_high_memory: - item.add_marker( - pytest.mark.skip( - "skipping high memory test since --run-high-memory was not set" - ) - ) - # Hypothesis hypothesis.settings.register_profile( diff --git a/pandas/tests/frame/methods/test_rank.py b/pandas/tests/frame/methods/test_rank.py index 6c5831ad897d1..df29a0e0b0fad 100644 --- a/pandas/tests/frame/methods/test_rank.py +++ b/pandas/tests/frame/methods/test_rank.py @@ -325,7 +325,6 @@ def test_rank_pct_true(self, method, exp): tm.assert_frame_equal(result, expected) @pytest.mark.single - @pytest.mark.high_memory def test_pct_max_many_rows(self): # GH 18271 df = DataFrame( diff --git a/pandas/tests/io/conftest.py b/pandas/tests/io/conftest.py index 8c34ca8056a07..43ff2103c6576 100644 --- a/pandas/tests/io/conftest.py +++ b/pandas/tests/io/conftest.py @@ -163,3 +163,11 @@ def add_tips_files(bucket_name): while cli.list_buckets()["Buckets"] and timeout > 0: time.sleep(0.1) timeout -= 0.1 + + +def pytest_collection_modifyitems(items, config): + for item in items: + # All tests that use the s3_resource should be run with 1 cpu core in the CI + # to (hopefully) reduce flakiness (i.e. moto_server timeout) in test execution + if "s3_resource" in getattr(item, "fixturenames", ()): + item.add_marker(pytest.mark.single) diff --git a/pandas/tests/io/parser/test_c_parser_only.py b/pandas/tests/io/parser/test_c_parser_only.py index 5df4470635af5..611ed59501673 100644 --- a/pandas/tests/io/parser/test_c_parser_only.py +++ b/pandas/tests/io/parser/test_c_parser_only.py @@ -555,7 +555,9 @@ def test_read_tarfile(c_parser_only, csv_dir_path, tar_suffix): tm.assert_frame_equal(out, expected) -@pytest.mark.high_memory +@pytest.mark.single +@td.skip_if_windows # CI: MemoryError +@td.skip_if_32bit # CI: OverflowError: join() result is too long for a Python string def test_bytes_exceed_2gb(c_parser_only): # see gh-16798 # diff --git a/pandas/tests/io/test_sql.py b/pandas/tests/io/test_sql.py index 92a53a443b217..1c8b5ee7e963a 100644 --- a/pandas/tests/io/test_sql.py +++ b/pandas/tests/io/test_sql.py @@ -1091,7 +1091,7 @@ def test_escaped_table_name(self): tm.assert_frame_equal(res, df) -@pytest.mark.single +@pytest.mark.db @pytest.mark.skipif(not SQLALCHEMY_INSTALLED, reason="SQLAlchemy not installed") class TestSQLApi(SQLAlchemyMixIn, _TestSQLApi): """ @@ -1317,12 +1317,12 @@ def setup_method(self, load_iris_data, load_types_data): self.pandasSQL = sql.SQLDatabase(self.__engine) -@pytest.mark.single +@pytest.mark.db class TestSQLApiConn(_EngineToConnMixin, TestSQLApi): pass -@pytest.mark.single +@pytest.mark.db class TestSQLiteFallbackApi(SQLiteMixIn, _TestSQLApi): """ Test the public sqlite connection fallback API @@ -2413,36 +2413,32 @@ def psql_insert_copy(table, conn, keys, data_iter): tm.assert_frame_equal(result, expected) -@pytest.mark.single @pytest.mark.db class TestMySQLAlchemy(_TestMySQLAlchemy, _TestSQLAlchemy): pass -@pytest.mark.single @pytest.mark.db class TestMySQLAlchemyConn(_TestMySQLAlchemy, _TestSQLAlchemyConn): pass -@pytest.mark.single @pytest.mark.db class TestPostgreSQLAlchemy(_TestPostgreSQLAlchemy, _TestSQLAlchemy): pass -@pytest.mark.single @pytest.mark.db class TestPostgreSQLAlchemyConn(_TestPostgreSQLAlchemy, _TestSQLAlchemyConn): pass -@pytest.mark.single +@pytest.mark.db class TestSQLiteAlchemy(_TestSQLiteAlchemy, _TestSQLAlchemy): pass -@pytest.mark.single +@pytest.mark.db class TestSQLiteAlchemyConn(_TestSQLiteAlchemy, _TestSQLAlchemyConn): pass @@ -2451,7 +2447,7 @@ class TestSQLiteAlchemyConn(_TestSQLiteAlchemy, _TestSQLAlchemyConn): # -- Test Sqlite / MySQL fallback -@pytest.mark.single +@pytest.mark.db class TestSQLiteFallback(SQLiteMixIn, PandasSQLTest): """ Test the fallback mode against an in-memory sqlite database. diff --git a/pandas/tests/series/methods/test_rank.py b/pandas/tests/series/methods/test_rank.py index 088e10b0ba070..12369e972abec 100644 --- a/pandas/tests/series/methods/test_rank.py +++ b/pandas/tests/series/methods/test_rank.py @@ -480,7 +480,6 @@ def test_rank_first_pct(dtype, ser, exp): @pytest.mark.single -@pytest.mark.high_memory def test_pct_max_many_rows(): # GH 18271 s = Series(np.arange(2 ** 24 + 1)) diff --git a/pandas/tests/test_algos.py b/pandas/tests/test_algos.py index 779d6e6b6bb0f..32d758846b8e9 100644 --- a/pandas/tests/test_algos.py +++ b/pandas/tests/test_algos.py @@ -1784,7 +1784,6 @@ def test_too_many_ndims(self): algos.rank(arr) @pytest.mark.single - @pytest.mark.high_memory def test_pct_max_many_rows(self): # GH 18271 values = np.arange(2 ** 24 + 1) diff --git a/pyproject.toml b/pyproject.toml index 0c3e078d8761a..cfc3dd2b6c98f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,6 @@ markers = [ "slow: mark a test as slow", "network: mark a test as network", "db: tests requiring a database (mysql or postgres)", - "high_memory: mark a test as a high-memory only", "clipboard: mark a pd.read_clipboard test", "arm_slow: mark a test as slow for arm64 architecture", "arraymanager: mark a test to run with ArrayManager enabled",