Skip to content

Commit

Permalink
TST: comments and skipif for broken warning catching
Browse files Browse the repository at this point in the history
  • Loading branch information
toobaz committed Apr 22, 2018
1 parent df9e8e2 commit d035b52
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pandas/tests/indexing/test_indexing.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from pandas.core.indexing import _non_reducing_slice, _maybe_numeric_slice
from pandas import NaT, DataFrame, Index, Series, MultiIndex
import pandas.util.testing as tm
from pandas.compat import PY2

from pandas.tests.indexing.common import Base, _mklbl

Expand Down Expand Up @@ -131,6 +132,8 @@ def test_setitem_dtype_upcast(self):
assert is_float_dtype(left['foo'])
assert is_float_dtype(left['baz'])

@pytest.mark.skipif(PY2, reason=("Catching warnings unreliable with "
"Python 2 (GH #20770)"))
def test_dups_fancy_indexing(self):

# GH 3455
Expand Down Expand Up @@ -192,6 +195,7 @@ def test_dups_fancy_indexing(self):
result = df.loc[rows]
tm.assert_frame_equal(result, expected)

# List containing only missing label
dfnu = DataFrame(np.random.randn(5, 3), index=list('AABCD'))
with pytest.raises(KeyError):
dfnu.ix[['E']]
Expand Down
3 changes: 3 additions & 0 deletions pandas/tests/indexing/test_loc.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
from pandas.util import testing as tm
from pandas.tests.indexing.common import Base
from pandas.api.types import is_scalar
from pandas.compat import PY2


class TestLoc(Base):
Expand Down Expand Up @@ -152,6 +153,8 @@ def test_loc_getitem_label_list(self):
[Timestamp('20130102'), Timestamp('20130103')],
typs=['ts'], axes=0)

@pytest.mark.skipif(PY2, reason=("Catching warnings unreliable with "
"Python 2 (GH #20770)"))
def test_loc_getitem_label_list_with_missing(self):
self.check_result('list lbl', 'loc', [0, 1, 2], 'indexer', [0, 1, 2],
typs=['empty'], fails=KeyError)
Expand Down

0 comments on commit d035b52

Please sign in to comment.