Skip to content

python.testing.pytestPath does not work with test discovery. #19317

Description

Discussed in #19316

Originally posted by ProfessorCode212 June 16, 2022
I get the following uncaught error for the Python Extension in VS Code. This only happens inside venv. It doesn't seem to be able to detect my system-wide pytest installation. I have even set python.testing.pytestPath to ~/.local/bin/pytest.

Traceback (most recent call last): 
File "/home/pc/.vscode/extensions/ms-python.python-2022.8.0/pythonFiles/testing_tools/run_adapter.py",
 line 17, in <module> from testing_tools.adapter.__main__ import parse_args,
 main File "/home/pc/.vscode/extensions/ms-python.python-2022.8.0/pythonFiles/testing_tools/adapter/__main__.py",
 line 9, in <module> from . import pytest,
 report File "/home/pc/.vscode/extensions/ms-python.python-2022.8.0/pythonFiles/testing_tools/adapter/pytest/__init__.py",
 line 7, in <module> from ._discovery import discover 
File "/home/pc/.vscode/extensions/ms-python.python-2022.8.0/pythonFiles/testing_tools/adapter/pytest/_discovery.py",
 line 8, in <module> import pytest
 ModuleNotFoundError: No module named 'pytest'

This problem does get fixed if I install pytest into the relevant venv but I am wondering if there is a way around it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-testingbugIssue identified by VS Code Team member as probable bugcommunity askFeature request that the community expressed interest infeature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions