Skip to content

Commit

Permalink
Merge pull request #241 from amoralej/master
Browse files Browse the repository at this point in the history
Discover python executable when discover is not used
  • Loading branch information
mtreinish committed May 14, 2019
2 parents 58fdc8c + 2dc62b3 commit 23148e7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion stestr/commands/run.py
Expand Up @@ -348,7 +348,15 @@ def run_command(config='.stestr.conf', repo_type='file',
if ids.find('/') != -1:
root = ids.replace('.py', '')
ids = root.replace('/', '.')
run_cmd = 'python -m subunit.run ' + ids
stestr_python = sys.executable
if os.environ.get('PYTHON'):
python_bin = os.environ.get('PYTHON')
elif stestr_python:
python_bin = stestr_python
else:
raise RuntimeError("The Python interpreter was not found and "
"PYTHON is not set")
run_cmd = python_bin + ' -m subunit.run ' + ids

def run_tests():
run_proc = [('subunit', output.ReturnCodeToSubunit(
Expand Down

0 comments on commit 23148e7

Please sign in to comment.