@@ -2573,7 +2573,9 @@ def test_tuple_index(self):
25732573 idx = [(0. , 1. ), (2. , 3. ), (4. , 5. )]
25742574 data = np .random .randn (30 ).reshape ((3 , 10 ))
25752575 DF = DataFrame (data , index = idx , columns = col )
2576- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2576+
2577+ expected_warning = Warning if compat .PY35 else PerformanceWarning
2578+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
25772579 self ._check_roundtrip (DF , tm .assert_frame_equal )
25782580
25792581 def test_index_types (self ):
@@ -2585,23 +2587,25 @@ def test_index_types(self):
25852587 check_index_type = True ,
25862588 check_series_type = True )
25872589
2588- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2590+ # nose has a deprecation warning in 3.5
2591+ expected_warning = Warning if compat .PY35 else PerformanceWarning
2592+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
25892593 ser = Series (values , [0 , 'y' ])
25902594 self ._check_roundtrip (ser , func )
25912595
2592- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2596+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
25932597 ser = Series (values , [datetime .datetime .today (), 0 ])
25942598 self ._check_roundtrip (ser , func )
25952599
2596- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2600+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
25972601 ser = Series (values , ['y' , 0 ])
25982602 self ._check_roundtrip (ser , func )
25992603
2600- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2604+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
26012605 ser = Series (values , [datetime .date .today (), 'a' ])
26022606 self ._check_roundtrip (ser , func )
26032607
2604- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2608+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
26052609 ser = Series (values , [1.23 , 'b' ])
26062610 self ._check_roundtrip (ser , func )
26072611
@@ -3377,7 +3381,8 @@ def test_retain_index_attributes2(self):
33773381
33783382 with ensure_clean_path (self .path ) as path :
33793383
3380- with tm .assert_produces_warning (expected_warning = AttributeConflictWarning ):
3384+ expected_warning = Warning if compat .PY35 else AttributeConflictWarning
3385+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
33813386
33823387 df = DataFrame (dict (A = Series (lrange (3 ), index = date_range ('2000-1-1' ,periods = 3 ,freq = 'H' ))))
33833388 df .to_hdf (path ,'data' ,mode = 'w' ,append = True )
@@ -3391,7 +3396,7 @@ def test_retain_index_attributes2(self):
33913396
33923397 self .assertEqual (read_hdf (path ,'data' ).index .name , 'foo' )
33933398
3394- with tm .assert_produces_warning (expected_warning = AttributeConflictWarning ):
3399+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
33953400
33963401 idx2 = date_range ('2001-1-1' ,periods = 3 ,freq = 'H' )
33973402 idx2 .name = 'bar'
0 commit comments