Skip to content

Fix nightly CI with split case for pandas (around 3.0.0 version) #975

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Aug 8, 2024
Merged
28 changes: 17 additions & 11 deletions tests/test_utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,26 @@


def test_show_version():
with pytest_warns_bounded(
UserWarning,
match="Setuptools is replacing distutils",
upper="3.11.99",
version_str=platform.python_version(),
):
context: AbstractContextManager
if PD_LTE_22 and NUMPY20: # https://github.com/PyTables/PyTables/issues/1172
"""Test show_versions method types with split case for pandas and python versions."""
if PD_LTE_22:
context: AbstractContextManager = nullcontext()
# distutils warning is only raised with pandas<3.0.0
if NUMPY20: # https://github.com/PyTables/PyTables/issues/1172
context = pytest.raises(ValueError)
else:
context = nullcontext()
with context:
with (
pytest_warns_bounded(
UserWarning,
match="Setuptools is replacing distutils",
upper="3.11.99",
version_str=platform.python_version(),
),
context,
):
check(assert_type(pd.show_versions(True), None), type(None))
check(assert_type(pd.show_versions(False), None), type(None))
else:
check(assert_type(pd.show_versions(True), None), type(None))
check(assert_type(pd.show_versions(False), None), type(None))


def test_dummies():
Expand Down
Loading