I am running test discovery in vscode with pytest in the output shows me this command:
python /home/dave/.vscode/extensions/ms-python.python-2020.6.88468/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir /home/dave/PythonProjects/pytest_test -s --cache-clear .
Executing this command in the vscode shell leads to an import error.
dave@dave-desktop ~/PythonProjects/pytest_test master python /home/dave/.vscode/extensions/ms-python.python-2020.6.88468/pythonFiles/testing_tools/run_adapter.py discover pytest -- --rootdir /home/dave/PythonProjects/pytest_test -s --cache-clear .
Traceback (most recent call last):
File "/home/dave/.vscode/extensions/ms-python.python-2020.6.88468/pythonFiles/testing_tools/run_adapter.py", line 17, in <module>
from testing_tools.adapter.__main__ import parse_args, main
File "/home/dave/.vscode/extensions/ms-python.python-2020.6.88468/pythonFiles/testing_tools/adapter/__main__.py", line 9, in <module>
from . import pytest, report
File "/home/dave/.vscode/extensions/ms-python.python-2020.6.88468/pythonFiles/testing_tools/adapter/pytest/__init__.py", line 7, in <module>
from ._discovery import discover
File "/home/dave/.vscode/extensions/ms-python.python-2020.6.88468/pythonFiles/testing_tools/adapter/pytest/_discovery.py", line 8, in <module>
import pytest
ImportError: No module named pytest
Why does this show an error? Is this command executed from another directory. This is very frustrating, because i have no chance of analysing the error this way.