@@ -38,23 +38,34 @@ def test_concat_empty_dataframe_dtypes(self):
3838 def test_empty_frame_dtypes_ftypes (self ):
3939 empty_df = pd .DataFrame ()
4040 assert_series_equal (empty_df .dtypes , pd .Series (dtype = np .object ))
41- assert_series_equal (empty_df .ftypes , pd .Series (dtype = np .object ))
41+
42+ # GH 26705 - Assert .ftypes is deprecated
43+ with tm .assert_produces_warning (FutureWarning ):
44+ assert_series_equal (empty_df .ftypes , pd .Series (dtype = np .object ))
4245
4346 nocols_df = pd .DataFrame (index = [1 , 2 , 3 ])
4447 assert_series_equal (nocols_df .dtypes , pd .Series (dtype = np .object ))
45- assert_series_equal (nocols_df .ftypes , pd .Series (dtype = np .object ))
48+
49+ # GH 26705 - Assert .ftypes is deprecated
50+ with tm .assert_produces_warning (FutureWarning ):
51+ assert_series_equal (nocols_df .ftypes , pd .Series (dtype = np .object ))
4652
4753 norows_df = pd .DataFrame (columns = list ("abc" ))
4854 assert_series_equal (norows_df .dtypes , pd .Series (
4955 np .object , index = list ("abc" )))
50- assert_series_equal (norows_df .ftypes , pd .Series (
51- 'object:dense' , index = list ("abc" )))
56+
57+ # GH 26705 - Assert .ftypes is deprecated
58+ with tm .assert_produces_warning (FutureWarning ):
59+ assert_series_equal (norows_df .ftypes , pd .Series (
60+ 'object:dense' , index = list ("abc" )))
5261
5362 norows_int_df = pd .DataFrame (columns = list ("abc" )).astype (np .int32 )
5463 assert_series_equal (norows_int_df .dtypes , pd .Series (
5564 np .dtype ('int32' ), index = list ("abc" )))
56- assert_series_equal (norows_int_df .ftypes , pd .Series (
57- 'int32:dense' , index = list ("abc" )))
65+ # GH 26705 - Assert .ftypes is deprecated
66+ with tm .assert_produces_warning (FutureWarning ):
67+ assert_series_equal (norows_int_df .ftypes , pd .Series (
68+ 'int32:dense' , index = list ("abc" )))
5869
5970 odict = OrderedDict
6071 df = pd .DataFrame (odict ([('a' , 1 ), ('b' , True ), ('c' , 1.0 )]),
@@ -66,11 +77,17 @@ def test_empty_frame_dtypes_ftypes(self):
6677 ('b' , 'bool:dense' ),
6778 ('c' , 'float64:dense' )]))
6879 assert_series_equal (df .dtypes , ex_dtypes )
69- assert_series_equal (df .ftypes , ex_ftypes )
80+
81+ # GH 26705 - Assert .ftypes is deprecated
82+ with tm .assert_produces_warning (FutureWarning ):
83+ assert_series_equal (df .ftypes , ex_ftypes )
7084
7185 # same but for empty slice of df
7286 assert_series_equal (df [:0 ].dtypes , ex_dtypes )
73- assert_series_equal (df [:0 ].ftypes , ex_ftypes )
87+
88+ # GH 26705 - Assert .ftypes is deprecated
89+ with tm .assert_produces_warning (FutureWarning ):
90+ assert_series_equal (df [:0 ].ftypes , ex_ftypes )
7491
7592 def test_datetime_with_tz_dtypes (self ):
7693 tzframe = DataFrame ({'A' : date_range ('20130101' , periods = 3 ),
@@ -402,7 +419,10 @@ def test_ftypes(self):
402419 B = 'float32:dense' ,
403420 C = 'float16:dense' ,
404421 D = 'float64:dense' )).sort_values ()
405- result = frame .ftypes .sort_values ()
422+
423+ # GH 26705 - Assert .ftypes is deprecated
424+ with tm .assert_produces_warning (FutureWarning ):
425+ result = frame .ftypes .sort_values ()
406426 assert_series_equal (result , expected )
407427
408428 def test_astype (self ):
0 commit comments