I have no idea. I used to call pytest as a module, not as a command, so I tried to specify the same thing, but I get an error with no details. .vscode/settings.json
Then, I tried to insert a shell script like this, but the result was also not clear bash
#!/bin/bash
python -m pytest $* --cov=server --cov-report=xml
python - Imports break VSCode testing with pytest - Stack Overflow Hereās the workaround. tests/ini.py
import sys
sys.path.insert(0, ".")
So we can now test it with GUI.
I wonder if this is useful? If only some of the tests are run, of course, the areas not covered by them will ānot pass the testā in terms of coverage. It might be better to bundle the tests for coverage output into a shell script and not output coverage when running the tests from VSCode.
Testing Python in Visual Studio Code
This page is auto-translated from /nishio/VSCodeć§pytestć®čØå® using DeepL. If you looks something interesting but the auto-translated English is not good enough to understand it, feel free to let me know at @nishio_en. Iām very happy to spread my thought to non-Japanese readers.