Skip to main content

A blazingly fast Language Server Protocol implementation for pytest

Project description

pytest-language-server 🔥

Shamelessly vibed into existence 🤖✨

This entire LSP implementation was built from scratch in a single AI-assisted coding session. No template. No boilerplate. Just pure vibes and Rust. That's right - a complete, working Language Server Protocol implementation for pytest, vibed into reality through the power of modern AI tooling. Even this message about vibing was vibed into existence.

A blazingly fast Language Server Protocol (LSP) implementation for pytest, built with Rust.

Features

🎯 Go to Definition

Jump directly to fixture definitions from anywhere they're used:

  • Local fixtures in the same file
  • Fixtures in conftest.py files
  • Third-party fixtures from pytest plugins (pytest-mock, pytest-asyncio, etc.)
  • Respects pytest's fixture shadowing/priority rules

🔍 Find References

Find all usages of a fixture across your entire test suite:

  • Works from fixture definitions or usage sites
  • Character-position aware (distinguishes between fixture name and parameters)
  • Shows references in all test files

📚 Hover Documentation

View fixture information on hover:

  • Fixture signature
  • Source file location
  • Docstring (with proper formatting and dedenting)
  • Markdown support in docstrings

⚡️ Performance

Built with Rust for maximum performance:

  • Fast workspace scanning with concurrent file processing
  • Efficient AST parsing using rustpython-parser
  • Lock-free data structures with DashMap
  • Minimal memory footprint

Installation

Choose your preferred installation method:

📦 PyPI (Recommended)

The easiest way to install for Python projects:

# Using uv (recommended)
uv tool install pytest-language-server

# Or with pip
pip install pytest-language-server

# Or with pipx (isolated environment)
pipx install pytest-language-server

🍺 Homebrew (macOS/Linux)

Install via Homebrew for system-wide availability:

brew install bellini666/tap/pytest-language-server

To add the tap first:

brew tap bellini666/tap https://github.com/bellini666/pytest-language-server
brew install pytest-language-server

🦀 Cargo (Rust)

Install from crates.io if you have Rust installed:

cargo install pytest-language-server

📥 Pre-built Binaries

Download pre-built binaries from the GitHub Releases page.

Available for:

  • Linux: x86_64, aarch64, armv7 (glibc and musl)
  • macOS: Intel and Apple Silicon
  • Windows: x64 and x86

🔨 From Source

Build from source for development or customization:

git clone https://github.com/bellini666/pytest-language-server
cd pytest-language-server
cargo build --release

The binary will be at target/release/pytest-language-server.

Setup

Neovim (with nvim-lspconfig)

require'lspconfig'.pytest_lsp.setup{
  cmd = { "pytest-language-server" },
  filetypes = { "python" },
  root_dir = function(fname)
    return require'lspconfig'.util.root_pattern('pyproject.toml', 'setup.py', 'setup.cfg', 'pytest.ini')(fname)
  end,
}

VS Code

Install the extension from the marketplace (coming soon) or configure manually:

{
  "pytest-language-server.enable": true,
  "pytest-language-server.path": "pytest-language-server"
}

Other Editors

Any editor with LSP support can use pytest-language-server. Configure it to run the pytest-language-server command.

Configuration

Logging

Control log verbosity with the RUST_LOG environment variable:

# Minimal logging (default)
RUST_LOG=warn pytest-language-server

# Info level
RUST_LOG=info pytest-language-server

# Debug level (verbose)
RUST_LOG=debug pytest-language-server

# Trace level (very verbose)
RUST_LOG=trace pytest-language-server

Logs are written to stderr, so they won't interfere with LSP communication.

Virtual Environment Detection

The server automatically detects your Python virtual environment:

  1. Checks for .venv/, venv/, or env/ in your project root
  2. Falls back to $VIRTUAL_ENV environment variable
  3. Scans third-party pytest plugins for fixtures

Supported Fixture Patterns

Decorator Style

@pytest.fixture
def my_fixture():
    """Fixture docstring."""
    return 42

Assignment Style (pytest-mock)

mocker = pytest.fixture()(_mocker)

Async Fixtures

@pytest.fixture
async def async_fixture():
    return await some_async_operation()

Fixture Dependencies

@pytest.fixture
def fixture_a():
    return "a"

@pytest.fixture
def fixture_b(fixture_a):  # Go to definition works on fixture_a
    return fixture_a + "b"

Fixture Priority Rules

pytest-language-server correctly implements pytest's fixture shadowing rules:

  1. Same file: Fixtures defined in the same file have highest priority
  2. Closest conftest.py: Searches parent directories for conftest.py files
  3. Virtual environment: Third-party plugin fixtures

Supported Third-Party Fixtures

Automatically discovers fixtures from popular pytest plugins:

  • pytest-mock: mocker, class_mocker
  • pytest-asyncio: event_loop
  • pytest-django: Database fixtures
  • pytest-cov: Coverage fixtures
  • And any other pytest plugin in your environment

Architecture

  • Language: Rust 🦀
  • LSP Framework: tower-lsp
  • Parser: rustpython-parser
  • Concurrency: tokio async runtime
  • Data Structures: DashMap for lock-free concurrent access

Development

Prerequisites

  • Rust 1.83+ (2021 edition)
  • Python 3.10+ (for testing)

Building

cargo build --release

Running Tests

cargo test

Logging During Development

RUST_LOG=debug cargo run

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE file for details.

Acknowledgments

Built with:

Special thanks to the pytest team for creating such an amazing testing framework.


Made with ❤️ and Rust. Shamelessly vibed into existence. Blazingly fast. 🔥

When you need a pytest LSP and the vibes are just right.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest_language_server-0.3.0.tar.gz (47.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pytest_language_server-0.3.0-py3-none-win_amd64.whl (2.7 MB view details)

Uploaded Python 3Windows x86-64

pytest_language_server-0.3.0-py3-none-win32.whl (2.5 MB view details)

Uploaded Python 3Windows x86

pytest_language_server-0.3.0-py3-none-musllinux_1_2_x86_64.whl (3.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

pytest_language_server-0.3.0-py3-none-musllinux_1_2_i686.whl (3.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ i686

pytest_language_server-0.3.0-py3-none-musllinux_1_2_armv7l.whl (3.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARMv7l

pytest_language_server-0.3.0-py3-none-musllinux_1_2_aarch64.whl (3.1 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

pytest_language_server-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

pytest_language_server-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ s390x

pytest_language_server-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl (3.5 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ppc64le

pytest_language_server-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl (3.3 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ i686

pytest_language_server-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARMv7l

pytest_language_server-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

pytest_language_server-0.3.0-py3-none-macosx_11_0_arm64.whl (2.9 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

pytest_language_server-0.3.0-py3-none-macosx_10_12_x86_64.whl (3.0 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file pytest_language_server-0.3.0.tar.gz.

File metadata

  • Download URL: pytest_language_server-0.3.0.tar.gz
  • Upload date:
  • Size: 47.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pytest_language_server-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3fb755fe67532a3171255852d2e47b79a68de92a121c4613d1756dc21cdecaea
MD5 e779302d7a2e6baa99acef347811eeaf
BLAKE2b-256 d7fcd0ddf50a51f8dedc1f8d94041b81c4fb64cbb754b8dd991b7d6abc692272

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0.tar.gz:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 fb6ec5afc19684da30110a42780e6545c6f12e87ffc939c4f47b37f2fee54f24
MD5 a93e116de922eff32ae8dd30a1683653
BLAKE2b-256 c727d23e81f56f95a531af862dcd7e8b5e27a50fb5c5aa65fcb6478704dc6fc7

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-win_amd64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-win32.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-win32.whl
Algorithm Hash digest
SHA256 cc03573918297b5b74672949b69b3ece31db899947636ec600457e8cf7c07f70
MD5 702604d1b08ce51911f55b019df1c9b5
BLAKE2b-256 10eeca51bf255d25275b521054a7be57ec75346679ad32f7bc4b6231ee9d14da

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-win32.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ee36055ea839f4027a1e2c7a31fa903faaa8d76e21bb7f126fd9767facae59d4
MD5 d64c174fa66febaf10c5e5e21b153110
BLAKE2b-256 332edee294e7df7c94da73153b43ba5adb91507d761d168fe0437ee9faf73009

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-musllinux_1_2_x86_64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 20b0b5a1545e1b40f4089f3db1a4fe0e80b268a8c41a186682775189617502e0
MD5 a2f048178412823ea47c3697c834b8ad
BLAKE2b-256 27a11179b61aa6417b815e932855f3f8ee460abf0a03a2bca9c5d245bc9496cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-musllinux_1_2_i686.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-musllinux_1_2_armv7l.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-musllinux_1_2_armv7l.whl
Algorithm Hash digest
SHA256 517ef8000dbf40f91832a143e071df8c2795f694fe262ff995ef51aa2578d94d
MD5 2c8efef2c3041c8fa0fb90fccbf73fe3
BLAKE2b-256 d9a9f2de29ed580c2dfc73639780ce2142bbff25f6d19305f3975e0dcda1c18f

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-musllinux_1_2_armv7l.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 0be06017e7199bb97abd4f16f6f0669d85a3bfc6377cbe17f9dc08720c28c6b0
MD5 5f26f040db512e2f8234e74e8a609728
BLAKE2b-256 69b0ba67a3e84e065f31a938cc93ee57ef5d2283e68eb82ee745fd00b938a7c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-musllinux_1_2_aarch64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 595840d47481a1eaea9029c6977460b37cb2cbc1a743cfbb8492f6046ce92265
MD5 00e894cdb90b3c3740b1ce70cc39dbe5
BLAKE2b-256 2c70c44121acb21bb0bb0b71e3d7a46313fcc28317ef8afb368d7a7c6debb1d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
Algorithm Hash digest
SHA256 646d6eb2a60529dca35ea7d8ebcfaabb29657af6dfab1c74afb5fd3cfa42dce9
MD5 a942db87a00f6d5756f047456ed922bc
BLAKE2b-256 5c5759d8be7e5c51f809006b5a1dfac4ee2e0fe8c8332fc75ceb937c7b8a3925

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
Algorithm Hash digest
SHA256 99905e2c1f4228fc1ec29837a6c9a5618036c5618afe7bca346e18c11b0cb96f
MD5 b440f11ae62af413725ec849bcb0265d
BLAKE2b-256 e547d8d449080d8257e06b409839a2fb78b801db84a683285c5b9fbb512bc953

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 d70a0c0ce18a50093a601bc547ed8ade041048633d628673998124a6c2a7033c
MD5 1bea13a720d506eddf2cddd9d8275f6f
BLAKE2b-256 51c4b126655ed8f5bd12a22faa4f0190f90db6df58b6eacb548a127a883e6123

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8357075960a9bbc217140349dd5756d7c17f480c82d18b9ea6bf4509a14af01f
MD5 22aa3f3c9bcdaadccb0c8d98a771e2bd
BLAKE2b-256 a0fde0a846001d1094fe1b609cb1ab474c884fa42895628f714cc0d444cea7e1

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d5d9e7e82257c2654b9702f2a9b9f4a9b8434443c0dc455d521ed63ee7644c5f
MD5 7a50e15e09f10ae9a1621cd21d61d6a8
BLAKE2b-256 6c54bdaef2eddd60e79388a27ecb8230b8394962238475cef360625197a96144

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cbbd2c1eead6d4b28ec13001d6f194d660be04c8e1b97c08385eb6b6f5f69dd4
MD5 f021a8ec1a7dbeb6803b08ac82eebe53
BLAKE2b-256 7d8c4c575ce889f93abcdaaed92fdd9bb62f94309ae39cec0bd361b67a7ae8f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-macosx_11_0_arm64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pytest_language_server-0.3.0-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pytest_language_server-0.3.0-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d28155727e0ab9e1156c205900eeb5c94c2bbb9b840563284bcc82fe4da51266
MD5 c7b4e11ba792706309069356f81cda62
BLAKE2b-256 9355b35b5cca75395395f42293c5405e35810bd6fc7c206647345ecf4d95e834

See more details on using hashes here.

Provenance

The following attestation bundles were made for pytest_language_server-0.3.0-py3-none-macosx_10_12_x86_64.whl:

Publisher: release.yml on bellini666/pytest-language-server

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page