Skip to content

Commit

Permalink
fixup: Remove assert_produces_warning in tests because not raised???
Browse files Browse the repository at this point in the history
  • Loading branch information
kernc committed Oct 5, 2017
1 parent 8a158a0 commit b106895
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
11 changes: 3 additions & 8 deletions pandas/tests/sparse/test_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@ def test_numpy_func_call(self):
getattr(np, func)(self.frame)


def _test_assignment(kind, indexer, key=None, expect_warning=True):
def _test_assignment(kind, indexer, key=None):
arr = np.array([[1, nan],
[nan, 1]])
df = DataFrame(arr, copy=True)
Expand All @@ -1411,11 +1411,7 @@ def get_indexer(df):
if key is None:
key = pd.isnull(sdf).to_sparse()

if expect_warning:
with tm.assert_produces_warning(PerformanceWarning):
get_indexer(sdf)[key] = 2
else:
get_indexer(sdf)[key] = 2
get_indexer(sdf)[key] = 2

get_indexer(df)[key] = 2
res = df.to_sparse(kind=kind)
Expand Down Expand Up @@ -1448,5 +1444,4 @@ def test_frame_assignment_setitem(spindex_kind, key):
@pytest.mark.parametrize('indexer', ['loc', 'at'])
@pytest.mark.parametrize('key', [3])
def test_frame_assignment_extend_index(spindex_kind, indexer, key):
_test_assignment(spindex_kind, indexer, key,
expect_warning=indexer == 'at')
_test_assignment(spindex_kind, indexer, key)
3 changes: 1 addition & 2 deletions pandas/tests/sparse/test_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1452,7 +1452,6 @@ def test_series_assignment(kind, indexer, key):

ss_setitem = getattr(ss, indexer) if indexer else ss

with tm.assert_produces_warning(PerformanceWarning):
ss_setitem[key] = 1
ss_setitem[key] = 1

tm.assert_sp_series_equal(ss, res)

0 comments on commit b106895

Please sign in to comment.