diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index 9263409f7a7f8..18c03cd215e48 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -548,7 +548,18 @@ async def test_tab_complete_warning(self, ip): code = "import pandas as pd; df = pd.DataFrame()" await ip.run_code(code) - with tm.assert_produces_warning(None): + + # TODO: remove it when Ipython updates + # GH 33567, jedi version raises Deprecation warning in Ipython + import jedi + + if jedi.__version__ < "0.17.0": + warning = tm.assert_produces_warning(None) + else: + warning = tm.assert_produces_warning( + DeprecationWarning, check_stacklevel=False + ) + with warning: with provisionalcompleter("ignore"): list(ip.Completer.completions("df.", 1)) diff --git a/pandas/tests/resample/test_resampler_grouper.py b/pandas/tests/resample/test_resampler_grouper.py index 4e3585c0be884..19afe25766241 100644 --- a/pandas/tests/resample/test_resampler_grouper.py +++ b/pandas/tests/resample/test_resampler_grouper.py @@ -28,7 +28,15 @@ async def test_tab_complete_ipython6_warning(ip): ) await ip.run_code(code) - with tm.assert_produces_warning(None): + # TODO: remove it when Ipython updates + # GH 33567, jedi version raises Deprecation warning in Ipython + import jedi + + if jedi.__version__ < "0.17.0": + warning = tm.assert_produces_warning(None) + else: + warning = tm.assert_produces_warning(DeprecationWarning, check_stacklevel=False) + with warning: with provisionalcompleter("ignore"): list(ip.Completer.completions("rs.", 1)) diff --git a/pandas/tests/series/test_api.py b/pandas/tests/series/test_api.py index f96d6ddfc357e..901d983b51c02 100644 --- a/pandas/tests/series/test_api.py +++ b/pandas/tests/series/test_api.py @@ -501,7 +501,18 @@ async def test_tab_complete_warning(self, ip): code = "import pandas as pd; s = pd.Series()" await ip.run_code(code) - with tm.assert_produces_warning(None): + + # TODO: remove it when Ipython updates + # GH 33567, jedi version raises Deprecation warning in Ipython + import jedi + + if jedi.__version__ < "0.17.0": + warning = tm.assert_produces_warning(None) + else: + warning = tm.assert_produces_warning( + DeprecationWarning, check_stacklevel=False + ) + with warning: with provisionalcompleter("ignore"): list(ip.Completer.completions("s.", 1))