chore: remove bin dir and simplify tests.__main__ (#8507)

This commit is contained in:
skshetry
2022-11-01 13:05:53 +05:45
committed by GitHub
parent a172240536
commit f6849d2f06
4 changed files with 4 additions and 25 deletions
-1
View File
@@ -1,4 +1,3 @@
/tests
/dvc
/.github
/bin
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
PYTHONPATH=$DVC_HOME python -m dvc $@
-3
View File
@@ -1,3 +0,0 @@
@echo OFF
set PYTHONPATH=%DVC_HOME%
python -m dvc %*
+4 -18
View File
@@ -1,20 +1,6 @@
# Needs investigation, pylint was running tests
# Could be `pylint_pytest` plugin, skipping check for this file for now
# pylint: skip-file
if __name__ == "__main__":
import sys
import os
import sys
from subprocess import check_call
import pytest
REPO_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
os.chdir(REPO_ROOT)
os.putenv(
"PATH", ":".join([os.path.join(REPO_ROOT, "bin"), os.getenv("PATH")])
)
os.putenv("DVC_HOME", REPO_ROOT)
opts = "-v -n=auto --dist loadscope --cov=dvc --durations=50"
params = " ".join(sys.argv[1:])
cmd = f"{sys.executable} -m pytest {opts} {params}"
check_call(cmd, shell=True)
sys.exit(pytest.main(["-v", "-n=auto", *sys.argv[1:]]))