Repository navigation
Closed as duplicate
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Bug
Behaviour
Pytest discovery is stuck after finding all pytests displaying the last test - but does not display them in the side panel. Switching to the previous version - pytest discovery works as expected: the same tests are discovered and immediately test collection finishes.
Steps to reproduce:
- pytest sample with this settings
{
// Pytest configurations
"python.testing.pytestArgs": [
"backend/tests",
"-s",
"--no-cov",
"--envfile=.env.test"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true,
// // "python.analysis.extraPaths": ["/"],
"python.envFile": "${workspaceFolder}/.env.development.local",
}tests are in /backend/tests/unitand /backend/tests/integration the code is in /backend/appname and I am using this pyproject.toml file
[project]
name = "appname"
version = "0.0.1"
description = "AppName"
readme = {file = "README.md", content-type = "text/markdown; charset=UTF-8"}
requires-python = ">=3.12"
authors = [
{name = "xxx", email = "xxx"}
]
dependencies = [
"fastapi",
"sqlalchemy",
"pydantic",
"python-dotenv",
"passlib",
"psycopg2",
"passlib[argon2]",
"email_validator",
"tldextract"
]
[project.optional-dependencies]
test = [
"pytest",
"pytest_httpserver",
"docker",
"sqlalchemy_utils",
"pytest-dotenv",
"pytest-cov",
]
dev = [
"acesotrack[test]",
"alembic",
"ruff",
"mypy",
"pre-commit"
]
[build-system]
requires = ["setuptools>=75"]
build-backend = "setuptools.build_meta"
[tool.setuptools]
package-dir = {"" = "backend"}
packages = ["appname"]Problem
for the new extension, the trace output of python shows exactly the same tests as being discovered, but it is stuck before it can finish the test discovery

Extension version: 2024.22.0
VS Code version: Code 1.96.2 (fabdb6a30b49f79a7aba0f2ad9df9b399473380f, 2024-12-19T10:22:47.216Z)
OS version: Darwin x64 23.5.0
Modes:
Reacted by Jean-Carol Forato, Rémi, katarilabdeveloper, dnyn92, orkenstein, justinwaltrip-cognistx, Stephen Lomnes, Yaar, Ho Yin Chau, Chantal GO and 1 more
Metadata
Metadata
Assignees
Labels
triage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
Axel-Vivien commentedon Dec 27, 2024
Also affected by this
jcfrt commentedon Dec 27, 2024
I have a similar issue, test discovery never completes.
Rolling back to v2024.22.0 and restarting VS code entirely (not just restarting the Extension Host) did work around the issue.
roablep commentedon Dec 27, 2024
+1. Discovery works again after downgrading to 2024.22.0 (from 2024.22.1)
hchau630 commentedon Dec 27, 2024
I think this issue has already been reported in #24656.
andypohl commentedon Dec 27, 2024
I don't use pytest and I'm having the same issue so I went back to 2024.22.0 and it's working again for unittest.
roablep commentedon Dec 28, 2024
I'm curious how many VS Code users spent as much time as I did before finally realizing it was the plug-in version change.