mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-25 20:40:36 +03:00
R: Improve single file runner
This commit is contained in:
parent
78bd97ec51
commit
5584fa9fc8
4
.vscode/launch.json
vendored
4
.vscode/launch.json
vendored
|
@ -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
|
||||
},
|
||||
{
|
||||
|
|
9
rsconcept/backend/run_testfile.py
Normal file
9
rsconcept/backend/run_testfile.py
Normal 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}")
|
Loading…
Reference in New Issue
Block a user