@@ -2573,7 +2573,9 @@ def test_tuple_index(self):
2573
2573
idx = [(0. , 1. ), (2. , 3. ), (4. , 5. )]
2574
2574
data = np .random .randn (30 ).reshape ((3 , 10 ))
2575
2575
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 ):
2577
2579
self ._check_roundtrip (DF , tm .assert_frame_equal )
2578
2580
2579
2581
def test_index_types (self ):
@@ -2585,23 +2587,25 @@ def test_index_types(self):
2585
2587
check_index_type = True ,
2586
2588
check_series_type = True )
2587
2589
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 ):
2589
2593
ser = Series (values , [0 , 'y' ])
2590
2594
self ._check_roundtrip (ser , func )
2591
2595
2592
- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2596
+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
2593
2597
ser = Series (values , [datetime .datetime .today (), 0 ])
2594
2598
self ._check_roundtrip (ser , func )
2595
2599
2596
- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2600
+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
2597
2601
ser = Series (values , ['y' , 0 ])
2598
2602
self ._check_roundtrip (ser , func )
2599
2603
2600
- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2604
+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
2601
2605
ser = Series (values , [datetime .date .today (), 'a' ])
2602
2606
self ._check_roundtrip (ser , func )
2603
2607
2604
- with tm .assert_produces_warning (expected_warning = PerformanceWarning ):
2608
+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
2605
2609
ser = Series (values , [1.23 , 'b' ])
2606
2610
self ._check_roundtrip (ser , func )
2607
2611
@@ -3377,7 +3381,8 @@ def test_retain_index_attributes2(self):
3377
3381
3378
3382
with ensure_clean_path (self .path ) as path :
3379
3383
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 ):
3381
3386
3382
3387
df = DataFrame (dict (A = Series (lrange (3 ), index = date_range ('2000-1-1' ,periods = 3 ,freq = 'H' ))))
3383
3388
df .to_hdf (path ,'data' ,mode = 'w' ,append = True )
@@ -3391,7 +3396,7 @@ def test_retain_index_attributes2(self):
3391
3396
3392
3397
self .assertEqual (read_hdf (path ,'data' ).index .name , 'foo' )
3393
3398
3394
- with tm .assert_produces_warning (expected_warning = AttributeConflictWarning ):
3399
+ with tm .assert_produces_warning (expected_warning = expected_warning , check_stacklevel = False ):
3395
3400
3396
3401
idx2 = date_range ('2001-1-1' ,periods = 3 ,freq = 'H' )
3397
3402
idx2 .name = 'bar'
0 commit comments