Skip to content
Merged
Changes from all 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
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