forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed as not planned
Labels
area-testinginfo-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Bug
Behaviour
Discover tests is overriding standard testpaths after configuration with the "Configure Tests" command.
By forcing the selection of the directory, the pytest --collect-only test discovery is run with a single directory as the argument, which overrides any testpaths set in external tools, for example pyproject.toml
If the command allows skipping of the directory selection, and doesn't set the related pytestArgs setting, test discovery will run normally.
Steps to reproduce:
- Configure project with pyproject.toml with [tools.pytest.ini_options] that defines testspaths = ["some","list","of/different","testpaths"]
- Open in vscode with python plugin
- Select "Python: Configure Tests" from action menu, or via "Testing" -> button
- Select pytest
- Select root directory
- Discover tests takes a long time in large directory trees (e.g. .venv, libs, etc) because the configured testpaths are being overridden.
Diagnostic data
From the Python output logs:
....
2024-06-27 07:39:05.246 [info] > ./.bluegen-venv/bin/python -m pytest -p vscode_pytest --collect-only .
2024-06-27 07:39:05.246 [info] cwd: .
2024-06-27 07:39:07.900 [info] ============================= test session starts ==============================
....
From the settings:
{
...
"python.testing.pytestEnabled": true,
"python.testing.pytestArgs": [
"."
],
...
}
Extension version: 2024.8.1
VS Code version: Code 1.90.2 (5437499feb04f7a586f677b155b039bc2b3669eb, 2024-06-18T22:33:48.698Z)
OS version: Linux x64 6.8.0-36-generic
Modes:
Remote OS version: Linux x64 6.8.0-36-generic
Metadata
Metadata
Assignees
Labels
area-testinginfo-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team