From 19c9e536044b969bf7c5377e7b0a5dff55a6accf Mon Sep 17 00:00:00 2001 From: Anthony Sottile Date: Mon, 23 Sep 2019 08:56:09 -0700 Subject: [PATCH] Make sure to quote `sys.executable` as we're running a shell --- testing/test_parseopt.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/test_parseopt.py b/testing/test_parseopt.py index 5350974d786..d39065b8270 100644 --- a/testing/test_parseopt.py +++ b/testing/test_parseopt.py @@ -1,6 +1,7 @@ import argparse import distutils.spawn import os +import shlex import sys import py @@ -300,7 +301,7 @@ def test_argcomplete(testdir, monkeypatch): # so we use bash fp.write( 'COMP_WORDBREAKS="$COMP_WORDBREAKS" {} -m pytest 8>&1 9>&2'.format( - sys.executable + shlex.quote(sys.executable) ) ) # alternative would be exteneded Testdir.{run(),_run(),popen()} to be able