Skip to content

Commit

Permalink
Fix nightly CI with split case for pandas (around 3.0.0 version) (#975)
Browse files Browse the repository at this point in the history
* GH 927 Allow 'integer' in select_dtypes include argument

* TypeGuard clean up in dtypes/missing.pyi

* PR Feedback

* Restore pandas nightly CI build

* Correct freq in test

* Attempt to fix issue with show_versions and pandas>=3.0.0

* Attempt to fix issue with show_versions and pandas>=3.0.0
  • Loading branch information
loicdiridollou authored Aug 8, 2024
1 parent b3967c9 commit 2acc94d
Showing 1 changed file with 17 additions and 11 deletions.
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

0 comments on commit 2acc94d

Please sign in to comment.