use sys.executable instead of hardcoded python (#5763)

Co-authored-by: Saugat Pachhai (सौगात) <[email protected]>
This commit is contained in:
Saugat Pachhai
2021-04-03 07:22:07 +00:00
committed by GitHub
co-authored by Saugat Pachhai
parent 7b25a9de24
commit 19d0b2af56
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ os.putenv(
)
os.putenv("DVC_HOME", REPO_ROOT)
opts = "-v -n=auto --dist loadscope --cov=dvc --durations=0"
params = " ".join(sys.argv[1:])
cmd = f"pytest -v -n=auto --dist loadscope --cov=dvc --durations=0 {params}"
cmd = f"{sys.executable} -m pytest {opts} {params}"
check_call(cmd, shell=True)
+2 -1
View File
@@ -1,4 +1,5 @@
import subprocess
import sys
def test_no_remote_imports():
@@ -15,7 +16,7 @@ def test_no_remote_imports():
code = "import dvc.main, sys; print(' '.join(sys.modules))"
res = subprocess.run(
["python", "-c", code], stdout=subprocess.PIPE, check=True
[sys.executable, "-c", code], stdout=subprocess.PIPE, check=True
)
modules = res.stdout.decode().split()
assert not set(modules) & remote_modules