diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index 4149485be181d..eeb2c409e00d3 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -529,7 +529,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 + # jedi version raises Deprecation warning in Ipython + import jedi + + if jedi.__version__ < "0.16.0": + warning = tm.assert_produces_warning(None) + else: + warning = tm.assert_produces_warning( + DeprecationWarning, check_stacklevel=False + ) + with tm.assert_produces_warning(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 03c1445e099a0..4d64643bf10e7 100644 --- a/pandas/tests/resample/test_resampler_grouper.py +++ b/pandas/tests/resample/test_resampler_grouper.py @@ -28,7 +28,17 @@ 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 + # jedi version raises Deprecation warning in Ipython + import jedi + + if jedi.__version__ < "0.16.0": + warning = tm.assert_produces_warning(None) + else: + warning = tm.assert_produces_warning( + DeprecationWarning, check_stacklevel=False + ) + with tm.assert_produces_warning(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 302ca8d1aa43e..1818634b14504 100644 --- a/pandas/tests/series/test_api.py +++ b/pandas/tests/series/test_api.py @@ -491,7 +491,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 + # jedi version raises Deprecation warning in Ipython + import jedi + + if jedi.__version__ < "0.16.0": + warning = tm.assert_produces_warning(None) + else: + warning = tm.assert_produces_warning( + DeprecationWarning, check_stacklevel=False + ) + with tm.assert_produces_warning(warning): with provisionalcompleter("ignore"): list(ip.Completer.completions("s.", 1))