Skip to content

Commit 6932851

Browse files
committed
TST: Basic check that the global errstate remains unchanged.
1 parent c9df7b3 commit 6932851

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/test_util.py

+10
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,16 @@ def test_exactly_one_ref(self):
326326
self.assertEqual(bytearray(as_stolen_buf), b'test')
327327

328328

329+
def test_numpy_errstate_is_default():
330+
# The defaults since numpy 1.6.0
331+
expected = {'over': 'warn', 'divide': 'warn', 'invalid': 'warn',
332+
'under': 'ignore'}
333+
import numpy as np
334+
from pandas.compat import numpy # noqa
335+
# The errstate should be unchanged after that import.
336+
tm.assert_equal(np.geterr(), expected)
337+
338+
329339
if __name__ == '__main__':
330340
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
331341
exit=False)

0 commit comments

Comments
 (0)