Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest discovery broken in v2024.22.1 #24660

Closed
maxhoheiser opened this issue Dec 27, 2024 · 6 comments
Closed

pytest discovery broken in v2024.22.1 #24660

maxhoheiser opened this issue Dec 27, 2024 · 6 comments
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@maxhoheiser
Copy link

maxhoheiser commented Dec 27, 2024

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:

  1. 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
Image

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:

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Dec 27, 2024
@Axel-Vivien
Copy link

Also affected by this

@jcfrt
Copy link

jcfrt commented 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
Copy link

roablep commented Dec 27, 2024

+1. Discovery works again after downgrading to 2024.22.0 (from 2024.22.1)

@hchau630
Copy link

I think this issue has already been reported in #24656.

@andypohl
Copy link

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
Copy link

roablep commented 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

7 participants