Skip to content

Commit 7e87104

Browse files
Backport PR #39569: CI: ipython tab completion tests (#39570)
Co-authored-by: jbrockmendel <[email protected]>
1 parent c818e36 commit 7e87104

File tree

4 files changed

+12
-40
lines changed

4 files changed

+12
-40
lines changed

pandas/tests/arrays/categorical/test_warnings.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,8 @@ async def test_tab_complete_warning(self, ip):
1515
code = "import pandas as pd; c = Categorical([])"
1616
await ip.run_code(code)
1717

18-
# GH 31324 newer jedi version raises Deprecation warning
19-
import jedi
20-
21-
if jedi.__version__ < "0.16.0":
22-
warning = tm.assert_produces_warning(None)
23-
else:
24-
warning = tm.assert_produces_warning(
25-
DeprecationWarning, check_stacklevel=False
26-
)
27-
with warning:
18+
# GH 31324 newer jedi version raises Deprecation warning;
19+
# appears resolved 2021-02-02
20+
with tm.assert_produces_warning(None):
2821
with provisionalcompleter("ignore"):
2922
list(ip.Completer.completions("c.", 1))

pandas/tests/frame/test_api.py

+3-11
Original file line numberDiff line numberDiff line change
@@ -274,17 +274,9 @@ async def test_tab_complete_warning(self, ip, frame_or_series):
274274

275275
await ip.run_code(code)
276276

277-
# TODO: remove it when Ipython updates
278-
# GH 33567, jedi version raises Deprecation warning in Ipython
279-
import jedi
280-
281-
if jedi.__version__ < "0.17.0":
282-
warning = tm.assert_produces_warning(None)
283-
else:
284-
warning = tm.assert_produces_warning(
285-
DeprecationWarning, check_stacklevel=False
286-
)
287-
with warning:
277+
# GH 31324 newer jedi version raises Deprecation warning;
278+
# appears resolved 2021-02-02
279+
with tm.assert_produces_warning(None):
288280
with provisionalcompleter("ignore"):
289281
list(ip.Completer.completions("obj.", 1))
290282

pandas/tests/indexes/test_base.py

+3-10
Original file line numberDiff line numberDiff line change
@@ -1942,16 +1942,9 @@ async def test_tab_complete_warning(self, ip):
19421942
code = "import pandas as pd; idx = Index([1, 2])"
19431943
await ip.run_code(code)
19441944

1945-
# GH 31324 newer jedi version raises Deprecation warning
1946-
import jedi
1947-
1948-
if jedi.__version__ < "0.16.0":
1949-
warning = tm.assert_produces_warning(None)
1950-
else:
1951-
warning = tm.assert_produces_warning(
1952-
DeprecationWarning, check_stacklevel=False
1953-
)
1954-
with warning:
1945+
# GH 31324 newer jedi version raises Deprecation warning;
1946+
# appears resolved 2021-02-02
1947+
with tm.assert_produces_warning(None):
19551948
with provisionalcompleter("ignore"):
19561949
list(ip.Completer.completions("idx.", 4))
19571950

pandas/tests/resample/test_resampler_grouper.py

+3-9
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,9 @@ async def test_tab_complete_ipython6_warning(ip):
3131
)
3232
await ip.run_code(code)
3333

34-
# TODO: remove it when Ipython updates
35-
# GH 33567, jedi version raises Deprecation warning in Ipython
36-
import jedi
37-
38-
if jedi.__version__ < "0.17.0":
39-
warning = tm.assert_produces_warning(None)
40-
else:
41-
warning = tm.assert_produces_warning(DeprecationWarning, check_stacklevel=False)
42-
with warning:
34+
# GH 31324 newer jedi version raises Deprecation warning;
35+
# appears resolved 2021-02-02
36+
with tm.assert_produces_warning(None):
4337
with provisionalcompleter("ignore"):
4438
list(ip.Completer.completions("rs.", 1))
4539

0 commit comments

Comments
 (0)