Skip to content
Merged
Changes from 10 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 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
context = pytest.raises(ValueError)
else:
context = nullcontext()
with context:
check(assert_type(pd.show_versions(True), None), type(None))
check(assert_type(pd.show_versions(False), None), type(None))
"""Test show_versions method types with split case for pandas and python versions."""
if PD_LTE_22:
# distutils warning is only raised with pandas<3.0.0
with pytest_warns_bounded(
UserWarning,
match="Setuptools is replacing distutils",
upper="3.11.99",
version_str=platform.python_version(),
):
context: AbstractContextManager
if NUMPY20: # https://github.com/PyTables/PyTables/issues/1172
context = pytest.raises(ValueError)
else:
context = nullcontext()
with 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