How to add additional arguments similar to pycharm in VSCode #23109
Unanswered
shyamsunder-mudumba
asked this question in
Q&A
Replies: 1 comment
-
@shyamsunder-mudumba Sorry for the really long delay on this, I some how missed this. You need to pass relative paths, when you pass a path starting with "/" it is treated as absolute path:
this should have the same result. As for debugging, I would recommend using the "debug test" button on the test explorer. /cc @eleanorjboyd |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, Thank you for your work.
I used to use Pycharm for running my tests previously and now I have to use VSCode to run the tests, So I started using this extension. I am wondering how to pass additional arguments similar to pycharm (attached below)
, this Launches the pytest with ["arguments -n 1 --dist=loadgroup --json-report --self-contained-html -m module_tests integration_tests/runs/test_sample.py integration_tests/assertions"]
With the available information I have used below configuration in the settings.json
"python.testing.pytestArgs": [
"/integration_tests",
"-n1",
"--dist=loadgroup",
"--json-report",
"--self-contained-html",
"-m",
"module_tests"
"/integration_tests/assertions"
],
but this is resulting me in the Test Explorer to consider "integration_tests/assertions" folder as place to discover the tests but not as an argument after the test_workflow.py how it is launched in Pycharm as mentioned above.
I tired with below configuration in launch.json but still my tests are launched only as ["Running pytest with args: ['-p', 'vscode_pytest', '-n1', '--dist=loadgroup', '--json-report', '--self-contained-html', '/integration_tests/runs/test_workflow.py"] but not with the assertions folder as an argument
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"args": ["/integration_tests/assertions"]
"console": "integratedTerminal",
"justMyCode": false
}
]
}
Beta Was this translation helpful? Give feedback.
All reactions