@@ -1207,6 +1207,8 @@ def test_deprecated_levels(self):
12071207 self .assertFalse (LooseVersion (pd .__version__ ) >= '0.18' )
12081208
12091209 def test_removed_names_produces_warning (self ):
1210+
1211+ # 10482
12101212 with tm .assert_produces_warning (UserWarning ):
12111213 Categorical ([0 ,1 ], name = "a" )
12121214
@@ -3580,9 +3582,13 @@ def test_cat_accessor_api(self):
35803582 self .assertFalse (hasattr (invalid , 'cat' ))
35813583
35823584 def test_pickle_v0_14_1 (self ):
3583- cat = pd .Categorical (values = ['a' , 'b' , 'c' ],
3584- categories = ['a' , 'b' , 'c' , 'd' ],
3585- name = 'foobar' , ordered = False )
3585+
3586+ # we have the name warning
3587+ # 10482
3588+ with tm .assert_produces_warning (UserWarning ):
3589+ cat = pd .Categorical (values = ['a' , 'b' , 'c' ],
3590+ categories = ['a' , 'b' , 'c' , 'd' ],
3591+ name = 'foobar' , ordered = False )
35863592 pickle_path = os .path .join (tm .get_data_path (),
35873593 'categorical_0_14_1.pickle' )
35883594 # This code was executed once on v0.14.1 to generate the pickle:
@@ -3597,9 +3603,12 @@ def test_pickle_v0_15_2(self):
35973603 # ordered -> _ordered
35983604 # GH 9347
35993605
3600- cat = pd .Categorical (values = ['a' , 'b' , 'c' ],
3601- categories = ['a' , 'b' , 'c' , 'd' ],
3602- name = 'foobar' , ordered = False )
3606+ # we have the name warning
3607+ # 10482
3608+ with tm .assert_produces_warning (UserWarning ):
3609+ cat = pd .Categorical (values = ['a' , 'b' , 'c' ],
3610+ categories = ['a' , 'b' , 'c' , 'd' ],
3611+ name = 'foobar' , ordered = False )
36033612 pickle_path = os .path .join (tm .get_data_path (),
36043613 'categorical_0_15_2.pickle' )
36053614 # This code was executed once on v0.15.2 to generate the pickle:
0 commit comments