Skip to content

Commit 6843385

Browse files
committed
Avoid interactive pdb when pytest tests itself - fix 2023
The debugging.py calls post_mortem() on error and pdb will drops an interactive debugger when the stdin is a readable fd.
1 parent 3578f4e commit 6843385

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Ahn Ki-Wook
99
Alexander Johnson
1010
Alexei Kozlenok
1111
Anatoly Bubenkoff
12+
Andras Tim
1213
Andreas Zeidler
1314
Andrzej Ostrowski
1415
Andy Freeland

_pytest/pytester.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -909,7 +909,7 @@ def popen(self, cmdargs, stdout, stderr, **kw):
909909
str(os.getcwd()), env.get('PYTHONPATH', '')]))
910910
kw['env'] = env
911911
return subprocess.Popen(cmdargs,
912-
stdout=stdout, stderr=stderr, **kw)
912+
stdin=subprocess.DEVNULL, stdout=stdout, stderr=stderr, **kw)
913913

914914
def run(self, *cmdargs):
915915
"""Run a command with arguments.

changelog/2023.bugfix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Set ``stdin`` to ``DEVNULL`` in ``pytester.py.Testdir.popen()`` for avoid unwanted interactive ``pdb``

0 commit comments

Comments
 (0)