diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 7eae93a6a27e9..31ed5096991a6 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -173,8 +173,8 @@ jobs: pip install hypothesis>=6.34.2 pytest>=7.0.0 pytest-xdist>=2.2.0 pytest-asyncio>=0.17 cd .. # Not a good idea to test within the src tree python -c "import pandas; print(pandas.__version__); - pandas.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2', '--no-strict-data-files']); - pandas.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db', '--no-strict-data-files'])" + pandas.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2']); + pandas.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db'])" - uses: actions/upload-artifact@v3 with: name: sdist diff --git a/ci/test_wheels.py b/ci/test_wheels.py index d6f843d7b2c68..f861c1cbedcad 100644 --- a/ci/test_wheels.py +++ b/ci/test_wheels.py @@ -41,12 +41,10 @@ multi_args = [ "-m not clipboard and not single_cpu and not slow and not network and not db", "-n 2", - "--no-strict-data-files", ] pd.test(extra_args=multi_args) pd.test( extra_args=[ "-m not clipboard and single_cpu and not slow and not network and not db", - "--no-strict-data-files", ] ) diff --git a/ci/test_wheels_windows.bat b/ci/test_wheels_windows.bat index b8724d6d31cb5..6364169e53924 100644 --- a/ci/test_wheels_windows.bat +++ b/ci/test_wheels_windows.bat @@ -1,6 +1,6 @@ set test_command=import pandas as pd; print(pd.__version__); ^ -pd.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '--no-strict-data-files', '-n=2']); ^ -pd.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db', '--no-strict-data-files']) +pd.test(extra_args=['-m not clipboard and not single_cpu and not slow and not network and not db', '-n 2']); ^ +pd.test(extra_args=['-m not clipboard and single_cpu and not slow and not network and not db']) python --version pip install pytz six numpy python-dateutil tzdata>=2022.1 diff --git a/pandas/conftest.py b/pandas/conftest.py index 68f3c575ee93d..95bb2078d151c 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -103,9 +103,9 @@ def pytest_addoption(parser) -> None: parser.addoption( - "--no-strict-data-files", - action="store_false", - help="Don't fail if a test is skipped for missing data file.", + "--strict-data-files", + action="store_true", + help="Fail if a test is skipped for missing data file.", ) @@ -1112,9 +1112,9 @@ def all_numeric_accumulations(request): @pytest.fixture def strict_data_files(pytestconfig): """ - Returns the configuration for the test setting `--no-strict-data-files`. + Returns the configuration for the test setting `--strict-data-files`. """ - return pytestconfig.getoption("--no-strict-data-files") + return pytestconfig.getoption("--strict-data-files") @pytest.fixture @@ -1134,7 +1134,7 @@ def datapath(strict_data_files: str) -> Callable[..., str]: Raises ------ ValueError - If the path doesn't exist and the --no-strict-data-files option is not set. + If the path doesn't exist and the --strict-data-files option is set. """ BASE_PATH = os.path.join(os.path.dirname(__file__), "tests") @@ -1143,7 +1143,7 @@ def deco(*args): if not os.path.exists(path): if strict_data_files: raise ValueError( - f"Could not find file {path} and --no-strict-data-files is not set." + f"Could not find file {path} and --strict-data-files is set." ) pytest.skip(f"Could not find {path}.") return path diff --git a/pandas/tests/test_common.py b/pandas/tests/test_common.py index 15fa10b9e4289..d31f617b9be15 100644 --- a/pandas/tests/test_common.py +++ b/pandas/tests/test_common.py @@ -1,6 +1,5 @@ import collections from functools import partial -import os import string import numpy as np @@ -175,12 +174,6 @@ def test_version_tag(): ) -def test_pyproject_present(): - # Check pyproject.toml is present(relevant for wheels) - pyproject_loc = os.path.join(os.path.dirname(__file__), "../../pyproject.toml") - assert os.path.exists(pyproject_loc) - - @pytest.mark.parametrize( "obj", [(obj,) for obj in pd.__dict__.values() if callable(obj)] ) diff --git a/pyproject.toml b/pyproject.toml index 1bc530df74e87..04c87e3d10a86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -125,9 +125,6 @@ include-package-data = true include = ["pandas", "pandas.*"] namespaces = false -[tool.setuptools.package-data] -pandas = ["../pyproject.toml"] - [tool.setuptools.exclude-package-data] "*" = ["*.c", "*.h"] @@ -409,7 +406,7 @@ disable = [ [tool.pytest.ini_options] # sync minversion with pyproject.toml & install.rst minversion = "7.0" -addopts = "--strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml" +addopts = "--strict-data-files --strict-markers --strict-config --capture=no --durations=30 --junitxml=test-data.xml" empty_parameter_set_mark = "fail_at_collect" xfail_strict = true testpaths = "pandas" @@ -419,7 +416,6 @@ doctest_optionflags = [ "ELLIPSIS", ] filterwarnings = [ - "error::_pytest.warning_types.PytestUnknownMarkWarning", "error:::pandas", "error::ResourceWarning", "error::pytest.PytestUnraisableExceptionWarning",