Skip to content

test error mis-identified as "pytest not installed" #25786

@eleanorjboyd

Description

@eleanorjboyd

Bug: When pytest discovery failed due to a missing dependency (e.g., requests), the error was incorrectly displayed as "pytest Not Installed" instead of indicating the actual missing module.

Cause: The isPytestNotInstalledError function checked if the error message contained both "ModuleNotFoundError" and "pytest". However, the error message was prefixed with the localized string "pytest test discovery error", so any ModuleNotFoundError would match because "pytest" appeared in the prefix—not because pytest was the missing module.

Fix: Replaced the detection logic with a regex-based extractMissingModuleName function that parses the actual module name from patterns like No module named 'requests'. The error node now displays Missing Module: {modulename} for any missing dependency.

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bugtriage-neededNeeds assignment to the proper sub-team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions