Skip to content

Commit a39453c

Browse files
committed
Ignore PerformanceWarning -- avoid noise
By abolishing assert_produces_warning, we avoid inconsistently- raised warnings by different versions of underlying NumPy, e.g. on OS X.
1 parent a1f5c2a commit a39453c

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

pandas/tests/sparse/frame/test_frame.py

+7-8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
from pandas.tests.frame.test_api import SharedWithSparse
2323

2424

25+
pytestmark = pytest.mark.filterwarnings("ignore:Setting Sparse:PerformanceWarning")
26+
27+
2528
class TestSparseDataFrame(SharedWithSparse):
2629
klass = SparseDataFrame
2730

@@ -1333,24 +1336,21 @@ def spindex_kind(request):
13331336
@pytest.mark.parametrize('indexer', ['iat'])
13341337
@pytest.mark.parametrize('key', [(0, 0)])
13351338
def test_frame_assignment_at(spindex_kind, indexer, key):
1336-
with tm.assert_produces_warning(PerformanceWarning):
1337-
_test_assignment(spindex_kind, indexer, key)
1339+
_test_assignment(spindex_kind, indexer, key)
13381340

13391341

13401342
@pytest.mark.parametrize('indexer', ['at', 'loc', 'iloc'])
13411343
@pytest.mark.parametrize('key', [0,
13421344
[0, 1],
13431345
[True, False]])
13441346
def test_frame_assignment_loc(spindex_kind, indexer, key):
1345-
with tm.assert_produces_warning(PerformanceWarning):
1346-
_test_assignment(spindex_kind, indexer, key)
1347+
_test_assignment(spindex_kind, indexer, key)
13471348

13481349

13491350
@pytest.mark.parametrize('key', [None,
13501351
[True, False]])
13511352
def test_frame_assignment_setitem(spindex_kind, key):
1352-
with tm.assert_produces_warning(PerformanceWarning):
1353-
_test_assignment(spindex_kind, None, key)
1353+
_test_assignment(spindex_kind, None, key)
13541354

13551355

13561356
@pytest.mark.parametrize('key', [3])
@@ -1360,5 +1360,4 @@ def test_frame_assignment_extend_index_loc(spindex_kind, key):
13601360

13611361
@pytest.mark.parametrize('key', [3])
13621362
def test_frame_assignment_extend_index_at(spindex_kind, key):
1363-
with tm.assert_produces_warning(PerformanceWarning):
1364-
_test_assignment(spindex_kind, 'at', key)
1363+
_test_assignment(spindex_kind, 'at', key)

0 commit comments

Comments
 (0)