File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 9
9
import sys
10
10
import unittest
11
11
from textwrap import dedent
12
+ import warnings
12
13
13
14
from numpy import nan
14
15
from numpy .random import randn
@@ -30,12 +31,16 @@ def curpath():
30
31
class TestDataFrameFormatting (unittest .TestCase ):
31
32
_multiprocess_can_split_ = True
32
33
def setUp (self ):
33
- import warnings
34
- self .frame = _frame .copy ()
34
+ self .warn_filters = warnings .filters
35
35
warnings .filterwarnings ('ignore' ,
36
36
category = FutureWarning ,
37
37
module = ".*format" )
38
38
39
+ self .frame = _frame .copy ()
40
+
41
+ def tearDown (self ):
42
+ warnings .filters = self .warn_filters
43
+
39
44
def test_repr_embedded_ndarray (self ):
40
45
arr = np .empty (10 , dtype = [('err' , object )])
41
46
for i in range (len (arr )):
Original file line number Diff line number Diff line change @@ -2934,6 +2934,11 @@ def test_repr_big(self):
2934
2934
2935
2935
def test_repr_unsortable (self ):
2936
2936
# columns are not sortable
2937
+ import warnings
2938
+ warn_filters = warnings .filters
2939
+ warnings .filterwarnings ('ignore' ,
2940
+ category = FutureWarning ,
2941
+ module = ".*format" )
2937
2942
2938
2943
unsortable = DataFrame ({'foo' : [1 ] * 50 ,
2939
2944
datetime .today () : [1 ] * 50 ,
@@ -2953,6 +2958,8 @@ def test_repr_unsortable(self):
2953
2958
2954
2959
fmt .reset_printoptions ()
2955
2960
2961
+ warnings .filters = warn_filters
2962
+
2956
2963
def test_repr_unicode (self ):
2957
2964
uval = u'\u03c3 \u03c3 \u03c3 \u03c3 '
2958
2965
bval = uval .encode ('utf-8' )
Original file line number Diff line number Diff line change @@ -1319,6 +1319,11 @@ def test_format_sparse_display(self):
1319
1319
self .assertEqual (result [3 ], '1 0 0 0' )
1320
1320
1321
1321
def test_format_sparse_config (self ):
1322
+ import warnings
1323
+ warn_filters = warnings .filters
1324
+ warnings .filterwarnings ('ignore' ,
1325
+ category = FutureWarning ,
1326
+ module = ".*format" )
1322
1327
# #1538
1323
1328
pd .set_printoptions (multi_sparse = False )
1324
1329
@@ -1327,6 +1332,8 @@ def test_format_sparse_config(self):
1327
1332
1328
1333
pd .reset_printoptions ()
1329
1334
1335
+ warnings .filters = warn_filters
1336
+
1330
1337
def test_bounds (self ):
1331
1338
self .index ._bounds
1332
1339
You can’t perform that action at this time.
0 commit comments