Skip to content

Commit

Permalink
Do not call python directly but use sys.executable. Fixes #5872 (#5873)
Browse files Browse the repository at this point in the history
Do not call python directly but use sys.executable. Fixes #5872
  • Loading branch information
nicoddemus authored Sep 23, 2019
2 parents 018edf2 + 04c01fb commit 7c64d5d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion testing/test_parseopt.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,11 @@ def test_argcomplete(testdir, monkeypatch):
# redirect output from argcomplete to stdin and stderr is not trivial
# http://stackoverflow.com/q/12589419/1307905
# so we use bash
fp.write('COMP_WORDBREAKS="$COMP_WORDBREAKS" python -m pytest 8>&1 9>&2')
fp.write(
'COMP_WORDBREAKS="$COMP_WORDBREAKS" {} -m pytest 8>&1 9>&2'.format(
sys.executable
)
)
# alternative would be exteneded Testdir.{run(),_run(),popen()} to be able
# to handle a keyword argument env that replaces os.environ in popen or
# extends the copy, advantage: could not forget to restore
Expand Down

0 comments on commit 7c64d5d

Please sign in to comment.