Skip to content

Commit e3804d5

Browse files
committed
tests: mark test_nested_completer as flaky depending on readline implementation
1 parent 42a6be0 commit e3804d5

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

testing/test_pdb.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import os.path
99
import re
10+
import readline
1011
import subprocess
1112
import sys
1213
import textwrap
@@ -6243,10 +6244,11 @@ def check_completions():
62436244

62446245

62456246
@pytest.mark.xfail(
6246-
(3, 11) < sys.version_info < (3, 12, 12),
6247-
reason="Broken on 3.12 before 3.12.12",
6247+
(((3, 9) < sys.version_info < (3, 11)) and "libedit" in readline.__doc__),
6248+
reason="Flaky, depending on the readline implementation (GNU readline vs libedit) ",
62486249
)
62496250
def test_nested_completer(testdir):
6251+
has_libedit = "libedit" in readline.__doc__
62506252
p1 = testdir.makepyfile(
62516253
"""
62526254
import sys
@@ -6279,24 +6281,24 @@ class Config(DefaultConfig):
62796281
testdir.monkeypatch.setenv("PDBPP_COLORS", "0")
62806282
child = testdir.spawn(f"{quote(sys.executable)} {str(p1)}", expect_timeout=1)
62816283
child.send("completeme\t")
6282-
if sys.version_info < (3, 14):
6283-
child.expect_exact("\r\n(Pdb++) completeme_outer")
6284-
else:
6284+
if has_libedit:
62856285
child.expect_exact("\r\n(Pdb++) completeme\x07\r\x1b[19G_outer")
6286+
else:
6287+
child.expect_exact("\r\n(Pdb++) completeme_outer")
62866288
child.send("\nimport pdbpp; _p = pdbpp.Pdb(); _p.reset()")
62876289
child.send("\n_p.interaction(frames[0], None)\n")
62886290
child.expect_exact("\r\n-> frames.append(sys._getframe())\r\n(Pdb++) ")
62896291
child.send("completeme\t")
6290-
if sys.version_info < (3, 14):
6291-
child.expect_exact("completeme_inner")
6292-
else:
6292+
if has_libedit:
62936293
child.expect_exact("completeme\x07\r\x1b[19G_inner")
6294+
else:
6295+
child.expect_exact("completeme_inner")
62946296
child.send("\nq\n")
62956297
child.send("completeme\t")
6296-
if sys.version_info < (3, 14):
6297-
child.expect_exact("completeme_outer")
6298-
else:
6298+
if has_libedit:
62996299
child.expect_exact("completeme\x07\r\x1b[19G_outer")
6300+
else:
6301+
child.expect_exact("completeme_outer")
63006302
child.send("\n")
63016303
child.sendeof()
63026304

0 commit comments

Comments
 (0)