@@ -51,41 +51,34 @@ def test_display_float_format():
51
51
assert pd .get_option ("display.float_format" ) == formatter
52
52
53
53
54
- def test_display_types_none_allowed ():
54
+ def test_display_types_none_allowed_get_options ():
55
55
# GH 1230
56
56
# Initial values
57
+ assert_type (pd .options .display .chop_threshold , Optional [float ])
57
58
assert_type (pd .options .display .max_columns , Optional [int ])
58
59
assert_type (pd .options .display .max_colwidth , Optional [int ])
59
60
assert_type (pd .options .display .max_dir_items , Optional [int ])
60
61
assert_type (pd .options .display .max_rows , Optional [int ])
61
62
assert_type (pd .options .display .max_seq_items , Optional [int ])
62
63
assert_type (pd .options .display .min_rows , Optional [int ])
63
- # Test with None
64
+
65
+ def test_display_types_none_allowed_set_options ():
66
+ # GH 1230
67
+ # Test setting each option as None and then to a specific value
68
+ pd .options .display .chop_threshold = None
69
+ pd .options .display .chop_threshold = 0.9
64
70
pd .options .display .max_columns = None
65
- check (assert_type (pd .options .display .max_columns , None ), type (None ))
66
- pd .options .display .max_colwidth = None
67
- check (assert_type (pd .options .display .max_colwidth , None ), type (None ))
68
- pd .options .display .max_dir_items = None
69
- check (assert_type (pd .options .display .max_dir_items , None ), type (None ))
70
- pd .options .display .max_rows = None
71
- check (assert_type (pd .options .display .max_rows , None ), type (None ))
72
- pd .options .display .max_seq_items = None
73
- check (assert_type (pd .options .display .max_seq_items , None ), type (None ))
74
- pd .options .display .min_rows = None
75
- check (assert_type (pd .options .display .min_rows , None ), type (None ))
76
- # Test with integer values
77
71
pd .options .display .max_columns = 100
78
- check ( assert_type ( pd .options .display .max_columns , int ), int )
72
+ pd .options .display .max_colwidth = None
79
73
pd .options .display .max_colwidth = 100
80
- check ( assert_type ( pd .options .display .max_colwidth , int ), int )
74
+ pd .options .display .max_dir_items = None
81
75
pd .options .display .max_dir_items = 100
82
- check ( assert_type ( pd .options .display .max_dir_items , int ), int )
76
+ pd .options .display .max_rows = None
83
77
pd .options .display .max_rows = 100
84
- check ( assert_type ( pd .options .display .max_rows , int ), int )
78
+ pd .options .display .max_seq_items = None
85
79
pd .options .display .max_seq_items = 100
86
- check ( assert_type ( pd .options .display .max_seq_items , int ), int )
80
+ pd .options .display .min_rows = None
87
81
pd .options .display .min_rows = 100
88
- check (assert_type (pd .options .display .min_rows , int ), int )
89
82
90
83
91
84
def test_display_types_literal_constraints ():
0 commit comments