Skip to content

Commit 2044f49

Browse files
committed
Add pytest-language-server configuration for fixture navigation
Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
1 parent 488cbdc commit 2044f49

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,8 @@ Install the required language servers:
446446
* [BasedPyright](https://docs.basedpyright.com/latest/) with `uv tool install basedpyright`
447447
* [pylsp](https://github.com/python-lsp/python-lsp-server) with `uv tool install python-lsp-server[flake8] --with pylsp-rope`.
448448
It's used to get immediate flake8 feedback in the text editor.
449+
* [pytest-language-server](https://github.com/bellini666/pytest-language-server) with
450+
`uv tool install pytest-language-server`. It allows to navigate in pytest fixtures.
449451

450452
[ruff](https://docs.astral.sh/ruff/), which is also used as a language server, is already installed as a dev dependency.
451453

@@ -459,6 +461,7 @@ name = "python"
459461
language-servers = [
460462
"basedpyright",
461463
"pylsp",
464+
"pytest-language-server",
462465
"ruff",
463466
]
464467
auto-format = false

pyproject.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,3 +127,8 @@ exclude=[".git", ".venv", "data.py", "vm_data.py"]
127127
# We force them back to the upstream value, so we can just download the expected python version
128128
python-downloads = "automatic"
129129
python-preference = "managed"
130+
131+
[tool.pytest-language-server]
132+
# pytest-language-server shows some internal variables, like host, as undeclared fixture.
133+
# An undeclared fixture would be cought by pyright/mypy. Just disable that diagnostic.
134+
disabled_diagnostics = ["undeclared-fixture"]

0 commit comments

Comments
 (0)