Skip to content

Commit 4fb7a91

Browse files
committed
pdb: add test for --trace with --pdbcls
Ensures that #4111 is fixed, which happened in 92a2884 as a byproduct.
1 parent ff5e98c commit 4fb7a91

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

testing/test_pdb.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1148,7 +1148,11 @@ def test():
11481148
class Wrapped:
11491149
class MyPdb:
11501150
def set_trace(self, *args):
1151-
print("mypdb_called", args)
1151+
print("settrace_called", args)
1152+
1153+
def runcall(self, *args, **kwds):
1154+
print("runcall_called", args, kwds)
1155+
assert "func" in kwds
11521156
""",
11531157
)
11541158
result = testdir.runpytest(
@@ -1165,4 +1169,11 @@ def set_trace(self, *args):
11651169
str(p1), "--pdbcls=mypdb:Wrapped.MyPdb", syspathinsert=True
11661170
)
11671171
assert result.ret == 0
1168-
result.stdout.fnmatch_lines(["*mypdb_called*", "* 1 passed in *"])
1172+
result.stdout.fnmatch_lines(["*settrace_called*", "* 1 passed in *"])
1173+
1174+
# Ensure that it also works with --trace.
1175+
result = testdir.runpytest(
1176+
str(p1), "--pdbcls=mypdb:Wrapped.MyPdb", "--trace", syspathinsert=True
1177+
)
1178+
assert result.ret == 0
1179+
result.stdout.fnmatch_lines(["*runcall_called*", "* 1 passed in *"])

0 commit comments

Comments
 (0)