Skip to content

Commit 2acc94d

Browse files
Fix nightly CI with split case for pandas (around 3.0.0 version) (#975)
* 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
1 parent b3967c9 commit 2acc94d

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

tests/test_utility.py

+17-11
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,26 @@
1717

1818

1919
def test_show_version():
20-
with pytest_warns_bounded(
21-
UserWarning,
22-
match="Setuptools is replacing distutils",
23-
upper="3.11.99",
24-
version_str=platform.python_version(),
25-
):
26-
context: AbstractContextManager
27-
if PD_LTE_22 and NUMPY20: # https://github.com/PyTables/PyTables/issues/1172
20+
"""Test show_versions method types with split case for pandas and python versions."""
21+
if PD_LTE_22:
22+
context: AbstractContextManager = nullcontext()
23+
# distutils warning is only raised with pandas<3.0.0
24+
if NUMPY20: # https://github.com/PyTables/PyTables/issues/1172
2825
context = pytest.raises(ValueError)
29-
else:
30-
context = nullcontext()
31-
with context:
26+
with (
27+
pytest_warns_bounded(
28+
UserWarning,
29+
match="Setuptools is replacing distutils",
30+
upper="3.11.99",
31+
version_str=platform.python_version(),
32+
),
33+
context,
34+
):
3235
check(assert_type(pd.show_versions(True), None), type(None))
3336
check(assert_type(pd.show_versions(False), None), type(None))
37+
else:
38+
check(assert_type(pd.show_versions(True), None), type(None))
39+
check(assert_type(pd.show_versions(False), None), type(None))
3440

3541

3642
def test_dummies():

0 commit comments

Comments
 (0)