Skip to content

Commit cc18c85

Browse files
committed
Fix pytest running all tests when selecting a single test from VS Code
Move 'plotpy' from addopts to testpaths in [tool.pytest.ini_options]. The positional argument in addopts was causing pytest to always collect the entire test suite, ignoring the specific test path passed by VS Code. testpaths is only used as a fallback when no explicit paths are given.
1 parent 090f82a commit cc18c85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,9 @@ include = ["plotpy*"]
7878
version = { attr = "plotpy.__version__" }
7979

8080
[tool.pytest.ini_options]
81-
addopts = "plotpy --import-mode=importlib"
82-
# addopts = "plotpy --import-mode=importlib --show-windows" # Disable offscreen mode
81+
addopts = "--import-mode=importlib"
82+
testpaths = ["plotpy"]
83+
# addopts = "--import-mode=importlib --show-windows" # Disable offscreen mode
8384

8485
[tool.ruff]
8586
exclude = [".git", ".vscode", "build", "dist","venv*",".venv*"]

0 commit comments

Comments
 (0)