Due to the usage of docker-compose my python app is in a subdirectory of the workspace therefore I want to do something like this:
"python.testing.pytestArgs": [
"--rootdir=/composeDir/app",
"tests"
],
"python.testing.cwd": /composeDir/app
but this does not work as expected. Since the --rootdir option is passed to pytest by default with the workspace location, vscode executes this
python /root/.vscode-server/extensions/ms-python.python-2021.4.765268190/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir /composeDir -s --cache-clear /composeDir/manager
In other words the custom rootdir option becomes the argument and "tests" is completely ignored.
Due to the usage of docker-compose my python app is in a subdirectory of the workspace therefore I want to do something like this:
but this does not work as expected. Since the
--rootdiroption is passed to pytest by default with the workspace location, vscode executes thisIn other words the custom rootdir option becomes the argument and "tests" is completely ignored.