@@ -51,41 +51,35 @@ 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+
66+ def test_display_types_none_allowed_set_options ():
67+ # GH 1230
68+ # Test setting each option as None and then to a specific value
69+ pd .options .display .chop_threshold = None
70+ pd .options .display .chop_threshold = 0.9
6471 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
7772 pd .options .display .max_columns = 100
78- check ( assert_type ( pd .options .display .max_columns , int ), int )
73+ pd .options .display .max_colwidth = None
7974 pd .options .display .max_colwidth = 100
80- check ( assert_type ( pd .options .display .max_colwidth , int ), int )
75+ pd .options .display .max_dir_items = None
8176 pd .options .display .max_dir_items = 100
82- check ( assert_type ( pd .options .display .max_dir_items , int ), int )
77+ pd .options .display .max_rows = None
8378 pd .options .display .max_rows = 100
84- check ( assert_type ( pd .options .display .max_rows , int ), int )
79+ pd .options .display .max_seq_items = None
8580 pd .options .display .max_seq_items = 100
86- check ( assert_type ( pd .options .display .max_seq_items , int ), int )
81+ pd .options .display .min_rows = None
8782 pd .options .display .min_rows = 100
88- check (assert_type (pd .options .display .min_rows , int ), int )
8983
9084
9185def test_display_types_literal_constraints ():
0 commit comments