Skip to content

Commit

Permalink
Merge pull request #216 from ltoscano-rh/fix-default-executable
Browse files Browse the repository at this point in the history
Run commands through the same python used for stestr
  • Loading branch information
mtreinish authored Jan 22, 2019
2 parents a13f522 + f5cd476 commit 18d6150
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion stestr/config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,8 @@ def get_run_command(self, test_ids=None, regexes=None,
elif not top_dir:
top_dir = './'

python = 'python' if sys.platform == 'win32' else '${PYTHON:-python}'
python = sys.executable if sys.platform == 'win32' else \
'${PYTHON:-%s}' % (sys.executable)
command = "%s -m subunit.run discover -t" \
" %s %s $LISTOPT $IDOPTION" % (python, top_dir, test_path)
listopt = "--list"
Expand Down
1 change: 1 addition & 0 deletions stestr/tests/test_config_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def _check_get_run_command(self, mock_sys, mock_TestProcessorFixture,
expected_python='python',
expected_group_callback=mock.ANY):
mock_sys.platform = platform
mock_sys.executable = 'python'

fixture = \
self._testr_conf.get_run_command(test_path='fake_test_path',
Expand Down

0 comments on commit 18d6150

Please sign in to comment.