Skip to content

Commit 3803157

Browse files
Merge branch 'main' of github.com:loicdiridollou/pandas-stubs
2 parents c0e6a1d + fd0c3f5 commit 3803157

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/test_utility.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
from contextlib import nullcontext
1+
from contextlib import (
2+
AbstractContextManager,
3+
nullcontext,
4+
)
25
import platform
36

47
import pandas as pd
@@ -15,11 +18,10 @@
1518

1619
def test_show_version():
1720
"""Test show_versions method types with split case for pandas and python versions."""
18-
# https://github.com/PyTables/PyTables/issues/1172
19-
context = nullcontext()
2021
if PD_LTE_22:
22+
context: AbstractContextManager = nullcontext()
2123
# distutils warning is only raised with pandas<3.0.0
22-
if NUMPY20:
24+
if NUMPY20: # https://github.com/PyTables/PyTables/issues/1172
2325
context = pytest.raises(ValueError)
2426
with (
2527
pytest_warns_bounded(
@@ -33,9 +35,8 @@ def test_show_version():
3335
check(assert_type(pd.show_versions(True), None), type(None))
3436
check(assert_type(pd.show_versions(False), None), type(None))
3537
else:
36-
with context:
37-
check(assert_type(pd.show_versions(True), None), type(None))
38-
check(assert_type(pd.show_versions(False), None), type(None))
38+
check(assert_type(pd.show_versions(True), None), type(None))
39+
check(assert_type(pd.show_versions(False), None), type(None))
3940

4041

4142
def test_dummies():

0 commit comments

Comments
 (0)