Skip to content

Commit

Permalink
Avoid interactive pdb when pytest tests itself - fix pytest-dev#2023
Browse files Browse the repository at this point in the history
The debugging.py calls post_mortem() on error and pdb will drops an
interactive debugger when the stdin is a readable fd.
  • Loading branch information
andras-tim committed Jul 16, 2017
1 parent 3578f4e commit f53a7c0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Ahn Ki-Wook
Alexander Johnson
Alexei Kozlenok
Anatoly Bubenkoff
Andras Tim
Andreas Zeidler
Andrzej Ostrowski
Andy Freeland
Expand Down
2 changes: 1 addition & 1 deletion _pytest/pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,7 +909,7 @@ def popen(self, cmdargs, stdout, stderr, **kw):
str(os.getcwd()), env.get('PYTHONPATH', '')]))
kw['env'] = env
return subprocess.Popen(cmdargs,
stdout=stdout, stderr=stderr, **kw)
stdin=subprocess.DEVNULL, stdout=stdout, stderr=stderr, **kw)

def run(self, *cmdargs):
"""Run a command with arguments.
Expand Down
1 change: 1 addition & 0 deletions changelog/2023.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Set ``stdin`` to ``DEVNULL`` in ``pytester.py.Testdir.popen()`` for avoid unwanted interactive ``pdb``

0 comments on commit f53a7c0

Please sign in to comment.