[SOLVED] How to run blender-python tests in vscode?

Ok. I switched to pytest

And here’s bash script I set up as workspace python interpreter:

#!/usr/bin/bash
LOG=/tmp/blenderpython.log
if [[ "$1 $2" == "-m pytest" ]]; then
    FILE=~/.local/bin/pytest
    ARGS=${@:3}
else
    FILE=$1
    ARGS=${@:2}
fi
/opt/blender-2.83/blender --background --factory-startup --disable-autoexec -noaudio \
--python-expr "import sys; i=sys.argv.index('--'); sys.argv = sys.argv[i-1:i] + sys.argv[i+1:]" \
--python $FILE -- $ARGS |\
grep -v '^Blender\|^found bundled'

Tests are discovered, runnable, debuggable.