Skip to content

Getting "pytest test discovery error for workspace" when having multiple projects in workspace #23828

Open
@jimisola

Description

@jimisola

I typically have several projects open in VS Code, i.e. in the current workspace. They can be Python (hatch), Java (Maven), GitLab CI/CD Components etc. VS Code Python sometimes have issues with pytest discovery in non-Python projects which results in me not being able to use Test Explorer to run/debug tests.

A typical error message looks like this:

2024-07-17 14:18:20.859 [error] pytest test discovery error for workspace: /home/u30576/dev/clones/sysdev/devops/cicd-components/python

Version: 1.91.1
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:08:12.169Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Linux x64 6.5.0-41-generic

Metadata

Metadata

Assignees

Labels

area-testingbugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions