Skip to content

Commit 8ed8206

Browse files
committed
TST: disable PyTables PANDAS_TESTING_MODE - too many warnings
1 parent fcec82e commit 8ed8206

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

.travis.yml

-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ matrix:
5353
- FULL_DEPS=true
5454
- CLIPBOARD=xsel
5555
- JOB_NAME: "34_nslow"
56-
- PANDAS_TESTING_MODE="deprecate"
5756
- python: 2.7
5857
env:
5958
- EXPERIMENTAL=true
@@ -70,7 +69,6 @@ matrix:
7069
- FULL_DEPS=true
7170
- CLIPBOARD=xsel
7271
- JOB_NAME: "34_nslow"
73-
- PANDAS_TESTING_MODE="deprecate"
7472
- python: 2.7
7573
env:
7674
- EXPERIMENTAL=true

pandas/io/tests/test_pytables.py

+14
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,20 @@ def compat_assert_produces_warning(w,f):
123123

124124
class TestHDFStore(tm.TestCase):
125125

126+
@classmethod
127+
def setUpClass(cls):
128+
super(TestHDFStore, cls).setUpClass()
129+
130+
# Pytables 3.0.0 deprecates lots of things
131+
tm.reset_testing_mode()
132+
133+
@classmethod
134+
def tearDownClass(cls):
135+
super(TestHDFStore, cls).tearDownClass()
136+
137+
# Pytables 3.0.0 deprecates lots of things
138+
tm.set_testing_mode()
139+
126140
def setUp(self):
127141
warnings.filterwarnings(action='ignore', category=FutureWarning)
128142

pandas/util/testing.py

+13-3
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,19 @@
5555
_RAISE_NETWORK_ERROR_DEFAULT = False
5656

5757
# set testing_mode
58-
testing_mode = os.environ.get('PANDAS_TESTING_MODE','None')
59-
if 'deprecate' in testing_mode:
60-
warnings.simplefilter('always', DeprecationWarning)
58+
def set_testing_mode():
59+
# set the testing mode filters
60+
testing_mode = os.environ.get('PANDAS_TESTING_MODE','None')
61+
if 'deprecate' in testing_mode:
62+
warnings.simplefilter('always', DeprecationWarning)
63+
64+
def reset_testing_mode():
65+
# reset the testing mode filters
66+
testing_mode = os.environ.get('PANDAS_TESTING_MODE','None')
67+
if 'deprecate' in testing_mode:
68+
warnings.simplefilter('ignore', DeprecationWarning)
69+
70+
set_testing_mode()
6171

6272
class TestCase(unittest.TestCase):
6373

0 commit comments

Comments
 (0)