Skip to content

Commit 93d5f33

Browse files
author
tp
committed
add test for depr. attibute added to deprecation list
1 parent db92219 commit 93d5f33

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

doc/source/whatsnew/v0.23.1.txt

+2
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ Documentation Changes
4444
Bug Fixes
4545
~~~~~~~~~
4646

47+
- tab completion on :class:`Index` in IPython no longer shows out deprecation warnings (:issue:`21125`)
48+
4749
Groupby/Resample/Rolling
4850
^^^^^^^^^^^^^^^^^^^^^^^^
4951

pandas/tests/indexes/test_base.py

+11
Original file line numberDiff line numberDiff line change
@@ -2088,6 +2088,17 @@ def test_get_duplicates_deprecated(self):
20882088
with tm.assert_produces_warning(FutureWarning):
20892089
index.get_duplicates()
20902090

2091+
def test_tab_complete_warning(self, ip):
2092+
# https://github.com/pandas-dev/pandas/issues/16409
2093+
pytest.importorskip('IPython', minversion="6.0.0")
2094+
from IPython.core.completer import provisionalcompleter
2095+
2096+
code = "import pandas as pd; idx = pd.Index([1, 2])"
2097+
ip.run_code(code)
2098+
with tm.assert_produces_warning(None):
2099+
with provisionalcompleter('ignore'):
2100+
list(ip.Completer.completions('idx.', 4))
2101+
20912102

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

0 commit comments

Comments
 (0)