@@ -1207,6 +1207,8 @@ def test_deprecated_levels(self):
1207
1207
self .assertFalse (LooseVersion (pd .__version__ ) >= '0.18' )
1208
1208
1209
1209
def test_removed_names_produces_warning (self ):
1210
+
1211
+ # 10482
1210
1212
with tm .assert_produces_warning (UserWarning ):
1211
1213
Categorical ([0 ,1 ], name = "a" )
1212
1214
@@ -3580,9 +3582,13 @@ def test_cat_accessor_api(self):
3580
3582
self .assertFalse (hasattr (invalid , 'cat' ))
3581
3583
3582
3584
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 )
3586
3592
pickle_path = os .path .join (tm .get_data_path (),
3587
3593
'categorical_0_14_1.pickle' )
3588
3594
# This code was executed once on v0.14.1 to generate the pickle:
@@ -3597,9 +3603,12 @@ def test_pickle_v0_15_2(self):
3597
3603
# ordered -> _ordered
3598
3604
# GH 9347
3599
3605
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 )
3603
3612
pickle_path = os .path .join (tm .get_data_path (),
3604
3613
'categorical_0_15_2.pickle' )
3605
3614
# This code was executed once on v0.15.2 to generate the pickle:
0 commit comments