|
17 | 17 |
|
18 | 18 |
|
19 | 19 | 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 |
28 |
| - context = pytest.raises(ValueError) |
29 |
| - else: |
30 |
| - context = nullcontext() |
31 |
| - with context: |
32 |
| - check(assert_type(pd.show_versions(True), None), type(None)) |
33 |
| - check(assert_type(pd.show_versions(False), None), type(None)) |
| 20 | + """Test show_versions method types with split case for pandas and python versions.""" |
| 21 | + if PD_LTE_22: |
| 22 | + # distutils warning is only raised with pandas<3.0.0 |
| 23 | + with pytest_warns_bounded( |
| 24 | + UserWarning, |
| 25 | + match="Setuptools is replacing distutils", |
| 26 | + upper="3.11.99", |
| 27 | + version_str=platform.python_version(), |
| 28 | + ): |
| 29 | + context: AbstractContextManager |
| 30 | + if NUMPY20: # https://github.com/PyTables/PyTables/issues/1172 |
| 31 | + context = pytest.raises(ValueError) |
| 32 | + else: |
| 33 | + context = nullcontext() |
| 34 | + with context: |
| 35 | + check(assert_type(pd.show_versions(True), None), type(None)) |
| 36 | + 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)) |
34 | 40 |
|
35 | 41 |
|
36 | 42 | def test_dummies():
|
|
0 commit comments