File tree 1 file changed +8
-7
lines changed
1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
- from contextlib import nullcontext
1
+ from contextlib import (
2
+ AbstractContextManager ,
3
+ nullcontext ,
4
+ )
2
5
import platform
3
6
4
7
import pandas as pd
15
18
16
19
def test_show_version ():
17
20
"""Test show_versions method types with split case for pandas and python versions."""
18
- # https://github.com/PyTables/PyTables/issues/1172
19
- context = nullcontext ()
20
21
if PD_LTE_22 :
22
+ context : AbstractContextManager = nullcontext ()
21
23
# distutils warning is only raised with pandas<3.0.0
22
- if NUMPY20 :
24
+ if NUMPY20 : # https://github.com/PyTables/PyTables/issues/1172
23
25
context = pytest .raises (ValueError )
24
26
with (
25
27
pytest_warns_bounded (
@@ -33,9 +35,8 @@ def test_show_version():
33
35
check (assert_type (pd .show_versions (True ), None ), type (None ))
34
36
check (assert_type (pd .show_versions (False ), None ), type (None ))
35
37
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 ))
39
40
40
41
41
42
def test_dummies ():
You can’t perform that action at this time.
0 commit comments