From 1d2f89c507ba96a0b87823c7ee35ffc7bcbaaa04 Mon Sep 17 00:00:00 2001 From: jbrockmendel Date: Tue, 2 Feb 2021 15:33:55 -0800 Subject: [PATCH] Backport PR #39569: CI: ipython tab completion tests --- pandas/tests/arrays/categorical/test_warnings.py | 13 +++---------- pandas/tests/frame/test_api.py | 14 +++----------- pandas/tests/indexes/test_base.py | 13 +++---------- pandas/tests/resample/test_resampler_grouper.py | 12 +++--------- 4 files changed, 12 insertions(+), 40 deletions(-) diff --git a/pandas/tests/arrays/categorical/test_warnings.py b/pandas/tests/arrays/categorical/test_warnings.py index 9e164a250cdb1..6ba3347796e08 100644 --- a/pandas/tests/arrays/categorical/test_warnings.py +++ b/pandas/tests/arrays/categorical/test_warnings.py @@ -15,15 +15,8 @@ async def test_tab_complete_warning(self, ip): code = "import pandas as pd; c = Categorical([])" await ip.run_code(code) - # GH 31324 newer jedi version raises Deprecation warning - 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 warning: + # GH 31324 newer jedi version raises Deprecation warning; + # appears resolved 2021-02-02 + with tm.assert_produces_warning(None): with provisionalcompleter("ignore"): list(ip.Completer.completions("c.", 1)) diff --git a/pandas/tests/frame/test_api.py b/pandas/tests/frame/test_api.py index a7e2fa760b7e4..29a2d9c17202e 100644 --- a/pandas/tests/frame/test_api.py +++ b/pandas/tests/frame/test_api.py @@ -274,17 +274,9 @@ async def test_tab_complete_warning(self, ip, frame_or_series): await ip.run_code(code) - # 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: + # GH 31324 newer jedi version raises Deprecation warning; + # appears resolved 2021-02-02 + with tm.assert_produces_warning(None): with provisionalcompleter("ignore"): list(ip.Completer.completions("obj.", 1)) diff --git a/pandas/tests/indexes/test_base.py b/pandas/tests/indexes/test_base.py index 372a1d290bca0..8095943a34f4d 100644 --- a/pandas/tests/indexes/test_base.py +++ b/pandas/tests/indexes/test_base.py @@ -1942,16 +1942,9 @@ async def test_tab_complete_warning(self, ip): code = "import pandas as pd; idx = Index([1, 2])" await ip.run_code(code) - # GH 31324 newer jedi version raises Deprecation warning - 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 warning: + # GH 31324 newer jedi version raises Deprecation warning; + # appears resolved 2021-02-02 + with tm.assert_produces_warning(None): with provisionalcompleter("ignore"): list(ip.Completer.completions("idx.", 4)) diff --git a/pandas/tests/resample/test_resampler_grouper.py b/pandas/tests/resample/test_resampler_grouper.py index da5bb0eb59f70..41f2f34da635d 100644 --- a/pandas/tests/resample/test_resampler_grouper.py +++ b/pandas/tests/resample/test_resampler_grouper.py @@ -31,15 +31,9 @@ async def test_tab_complete_ipython6_warning(ip): ) await ip.run_code(code) - # 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: + # GH 31324 newer jedi version raises Deprecation warning; + # appears resolved 2021-02-02 + with tm.assert_produces_warning(None): with provisionalcompleter("ignore"): list(ip.Completer.completions("rs.", 1))