@@ -2664,27 +2664,27 @@ def test_constructor_data_aware_dtype_naive(self, tz_aware_fixture, pydt):
2664
2664
expected = DataFrame ({0 : [ts_naive ]})
2665
2665
tm .assert_frame_equal (result , expected )
2666
2666
2667
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
2667
+ with tm .assert_produces_warning (FutureWarning ):
2668
2668
result = DataFrame ({0 : ts }, index = [0 ], dtype = "datetime64[ns]" )
2669
2669
tm .assert_frame_equal (result , expected )
2670
2670
2671
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
2671
+ with tm .assert_produces_warning (FutureWarning ):
2672
2672
result = DataFrame ([ts ], dtype = "datetime64[ns]" )
2673
2673
tm .assert_frame_equal (result , expected )
2674
2674
2675
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
2675
+ with tm .assert_produces_warning (FutureWarning ):
2676
2676
result = DataFrame (np .array ([ts ], dtype = object ), dtype = "datetime64[ns]" )
2677
2677
tm .assert_frame_equal (result , expected )
2678
2678
2679
2679
with tm .assert_produces_warning (FutureWarning ):
2680
2680
result = DataFrame (ts , index = [0 ], columns = [0 ], dtype = "datetime64[ns]" )
2681
2681
tm .assert_frame_equal (result , expected )
2682
2682
2683
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
2683
+ with tm .assert_produces_warning (FutureWarning ):
2684
2684
df = DataFrame ([Series ([ts ])], dtype = "datetime64[ns]" )
2685
2685
tm .assert_frame_equal (result , expected )
2686
2686
2687
- with tm .assert_produces_warning (FutureWarning , check_stacklevel = False ):
2687
+ with tm .assert_produces_warning (FutureWarning ):
2688
2688
df = DataFrame ([[ts ]], columns = [0 ], dtype = "datetime64[ns]" )
2689
2689
tm .assert_equal (df , expected )
2690
2690
@@ -2946,9 +2946,7 @@ def test_tzaware_data_tznaive_dtype(self, constructor):
2946
2946
ts = Timestamp ("2019" , tz = tz )
2947
2947
ts_naive = Timestamp ("2019" )
2948
2948
2949
- with tm .assert_produces_warning (
2950
- FutureWarning , match = "Data is timezone-aware" , check_stacklevel = False
2951
- ):
2949
+ with tm .assert_produces_warning (FutureWarning , match = "Data is timezone-aware" ):
2952
2950
result = constructor (ts , dtype = "M8[ns]" )
2953
2951
2954
2952
assert np .all (result .dtypes == "M8[ns]" )
0 commit comments