R: Improve single file runner
Some checks are pending
Backend CI / build (3.12) (push) Waiting to run
Backend CI / notify-failure (push) Blocked by required conditions

This commit is contained in:
Ivan 2025-04-06 13:23:10 +03:00
parent 78bd97ec51
commit 5584fa9fc8
2 changed files with 11 additions and 2 deletions

4
.vscode/launch.json vendored
View File

@ -42,8 +42,8 @@
"type": "debugpy",
"request": "launch",
"cwd": "${workspaceFolder}/rsconcept/backend",
"program": "${workspaceFolder}/rsconcept/backend/manage.py",
"args": ["test", "-k", "${fileBasenameNoExtension}"],
"program": "${workspaceFolder}/rsconcept/backend/run_testfile.py",
"args": ["${file}"],
"django": true
},
{

View File

@ -0,0 +1,9 @@
import os
import sys
filepath = sys.argv[1]
project_root = os.path.join(os.path.dirname(__file__))
relpath = os.path.relpath(filepath, project_root)
module_path = relpath.replace('/', '.').replace('\\', '.').rstrip('.py')
os.system(f"python manage.py test {module_path}")