diff --git a/tests/__main__.py b/tests/__main__.py index c36e707d9..f3dbe0337 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -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) diff --git a/tests/unit/test_imports.py b/tests/unit/test_imports.py index a442d2a5c..ea7d815e6 100644 --- a/tests/unit/test_imports.py +++ b/tests/unit/test_imports.py @@ -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