@@ -51,41 +51,34 @@ def test_display_float_format():
5151 assert pd .get_option ("display.float_format" ) == formatter
5252
5353
54- def test_display_types_none_allowed ():
54+ def test_display_types_none_allowed_get_options ():
5555 # GH 1230
5656 # Initial values
57+ assert_type (pd .options .display .chop_threshold , Optional [float ])
5758 assert_type (pd .options .display .max_columns , Optional [int ])
5859 assert_type (pd .options .display .max_colwidth , Optional [int ])
5960 assert_type (pd .options .display .max_dir_items , Optional [int ])
6061 assert_type (pd .options .display .max_rows , Optional [int ])
6162 assert_type (pd .options .display .max_seq_items , Optional [int ])
6263 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
6470 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
7771 pd .options .display .max_columns = 100
78- check ( assert_type ( pd .options .display .max_columns , int ), int )
72+ pd .options .display .max_colwidth = None
7973 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
8175 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
8377 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
8579 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
8781 pd .options .display .min_rows = 100
88- check (assert_type (pd .options .display .min_rows , int ), int )
8982
9083
9184def test_display_types_literal_constraints ():
0 commit comments