Merge pull request #2580 from andras-tim/fix-runpytest-subprocess

Avoid interactive pdb when pytest tests itself - fix #2023
This commit is contained in:
Bruno Oliveira 2017-07-26 10:37:48 -03:00 committed by GitHub
commit 2c2cf81d0a
2 changed files with 6 additions and 2 deletions

View File

@ -916,8 +916,11 @@ class Testdir:
env['PYTHONPATH'] = os.pathsep.join(filter(None, [ env['PYTHONPATH'] = os.pathsep.join(filter(None, [
str(os.getcwd()), env.get('PYTHONPATH', '')])) str(os.getcwd()), env.get('PYTHONPATH', '')]))
kw['env'] = env kw['env'] = env
return subprocess.Popen(cmdargs,
stdout=stdout, stderr=stderr, **kw) popen = subprocess.Popen(cmdargs, stdin=subprocess.PIPE, stdout=stdout, stderr=stderr, **kw)
popen.stdin.close()
return popen
def run(self, *cmdargs): def run(self, *cmdargs):
"""Run a command with arguments. """Run a command with arguments.

1
changelog/2023.bugfix Normal file
View File

@ -0,0 +1 @@
Set ``stdin`` to a closed ``PIPE`` in ``pytester.py.Testdir.popen()`` for avoid unwanted interactive ``pdb``