Skip to content

Commit

Permalink
add test for depr. attibute added to deprecation list
Browse files Browse the repository at this point in the history
  • Loading branch information
tp committed May 19, 2018
1 parent db92219 commit 93d5f33
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
2 changes: 2 additions & 0 deletions doc/source/whatsnew/v0.23.1.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ Documentation Changes
Bug Fixes
~~~~~~~~~

- tab completion on :class:`Index` in IPython no longer shows out deprecation warnings (:issue:`21125`)

Groupby/Resample/Rolling
^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
11 changes: 11 additions & 0 deletions pandas/tests/indexes/test_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2088,6 +2088,17 @@ def test_get_duplicates_deprecated(self):
with tm.assert_produces_warning(FutureWarning):
index.get_duplicates()

def test_tab_complete_warning(self, ip):
# https://github.com/pandas-dev/pandas/issues/16409
pytest.importorskip('IPython', minversion="6.0.0")
from IPython.core.completer import provisionalcompleter

code = "import pandas as pd; idx = pd.Index([1, 2])"
ip.run_code(code)
with tm.assert_produces_warning(None):
with provisionalcompleter('ignore'):
list(ip.Completer.completions('idx.', 4))


class TestMixedIntIndex(Base):
# Mostly the tests from common.py for which the results differ
Expand Down

0 comments on commit 93d5f33

Please sign in to comment.