forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Closed as not planned
Copy link
Labels
area-testingcommunity askFeature request that the community expressed interest inFeature request that the community expressed interest infeature-requestRequest for new features or functionalityRequest for new features or functionalityinfo-neededIssue requires more information from posterIssue requires more information from posterneeds PRReady to be worked onReady to be worked on
Description
The feature request is to explicitly declare, which virtual environment should be used for tests.
I have sandboxed environments:
- project dependecies (used for editable installs, etc.)
- dev (used during development)
- test (used for tests)
During development I want to set:
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/dev/bin/python"However, in that case, tests cannot be discovered:
[error] /Users/timon/work/dagcellent/dagcellent/.venv/dev/bin/python: No module named pytestAs soon as I activate the test venv, discovery works.
Note that setting:
"python.testing.pytestPath": "${workspaceFolder}/.venv/test.py3.11/bin/pytest",seems to have no effect.
My .venv looks like this:
.venv
├── my_package
├── dev
└── test.py3.11
I am using hatch, but this can easily be replicated with poetry or other:
[tool.hatch.envs.dev]
extra-dependencies = [
"pre-commit == 3.7.*",
"ruff == 0.4.4",
"mypy == 1.10.*",
]
[tool.hatch.envs.dev.scripts]
install = "pre-commit install --hook-type commit-msg"
[tool.hatch.envs.test]
extra-dependencies = [
"pytest >= 8.0.0",
"pytest-cov",
"pytest-mock >= 3.14.0",
]murseld, avnes, emisaue, dandocan, chrijun and 9 more
Metadata
Metadata
Assignees
Labels
area-testingcommunity askFeature request that the community expressed interest inFeature request that the community expressed interest infeature-requestRequest for new features or functionalityRequest for new features or functionalityinfo-neededIssue requires more information from posterIssue requires more information from posterneeds PRReady to be worked onReady to be worked on