Open evandrocoan opened 1 year ago
👋 hi, The pytest options section is supposed to be used to add pytest options (https://docs.pytest.org/en/7.1.x/how-to/usage.html), the --use-running-containers is a docker option so you can try to use that in the docker exec command configuration. Hope I have been clear enough. Please let me know
Hi. --use-running-containers
is pytest option for the plugin https://github.com/pytest-docker-compose/pytest-docker-compose
I use it on the command line directly with pytest and it works fine: python3 -m pytest mytest --use-running-containers
.
VSCode was not complaining about the --use-running-containers
option, but it says it does not recognize pytest_runner.pytest_options
.
Got it, the pytest_options
in the settings files are supposed to be the options specified in the official doc right after the pytest
command, for example -s
or -x
etc... the option you mentioned --use-running-containers
should be used at the end of the command I suppose, so this required a change in the plugin. I can make it in the next few weeks or maybe, if you want, you can contribute :D happy to help. Thanks
Hi. I managed to use this option inside my .vscode/settings.json
. It looks like a option to pytest.
{
"python.testing.pytestArgs": [
".",
"--use-running-containers",
],
I think it would be appropriate to just update the docs and explain the option pytest_options
is just for default pytest options and for other options pytestArgs
can be used instead.
great Thanks
I added it to my settings file, but it says it is not recognized.![image](https://user-images.githubusercontent.com/5332158/182004286-9d4c0e81-ae37-4ed2-a305-1ef0373b6c67.png)
May be related to: https://github.com/ernestoarbitrio/pytest-runner/pull/61/files