--- id: pytest-grpc version: "0.8.0" license: MIT license_treatment: permissive maintenance: abandoned --- # pytest-grpc — pytest plugin for grpc License: permissive · Maintenance: abandoned · Downloads: 180.0K/mo ## What it is and what it does pytest-grpc is a pytest plugin that simplifies testing gRPC services by providing pre-built fixtures for server setup, channel creation, and stub instantiation. It lets you write tests that call gRPC handlers directly, without manually managing server lifecycle or channel configuration. The plugin supports two testing modes: a real gRPC server running in a background thread and a fake in-process mode that bypasses the network layer for faster unit tests. You define fixtures to inject your service implementation and protobuf stubs, then write test functions that receive a ready-to-use stub. It also supports SSL/TLS by allowing you to override the default server and channel fixtures with custom credentials. Use it for: - Unit-test individual gRPC service handlers without spinning up a real server - Integration-test gRPC services against a real server running in a pytest worker thread - Test gRPC services with SSL/TLS by providing custom certificate and key fixtures - Verify error handling in gRPC handlers by catching exceptions raised during RPC calls ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. A pytest plugin that provides fixtures to write and run tests for gRPC services, supporting both real server and fake in-process testing modes. No—the package is abandoned (last release 2020-05-01) with no maintenance signal. While it has low install friction and a permissive MIT license, the lack of updates means it will likely break with newer pytest or gRPC versions. Use only if locked to old dependencies; otherwise, maintain your own test fixtures or evaluate actively maintained alternatives. ## Install pip install pytest-grpc uv add pytest-grpc poetry add pytest-grpc ## Installing pytest-grpc Before you install: Installation is straightforward with only pytest as a runtime dependency. However, the package is abandoned—last released 2020-05-01 with no recent maintenance, so expect no bug fixes or updates for modern gRPC or pytest versions. License in practice: MIT license permits free use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects. Quickstart: pip install pytest-grpc import pytest @pytest.fixture(scope='module') def grpc_add_to_server(): # Import your generated gRPC add_*_to_server function pass @pytest.fixture(scope='module') def grpc_servicer(): # Return your service implementation pass def test_handler(grpc_stub): # grpc_stub is provided by the plugin response = grpc_stub.handler(request) assert response is not None Requires proto files compiled to *_pb2.py and *_pb2_grpc.py using grpcio-tools before tests can run. Verify before relying: - Whether the package remains compatible with current versions of pytest and grpcio - Whether SSL/TLS fixture overrides work reliably with modern gRPC channel APIs - What Python versions beyond 3.6 and 3.7 are actually supported despite the abandoned status ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 180.0K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags pytest grpc testing, grpc service unit tests, grpc mock server testing, pytest fixtures grpc, grpc integration testing, grpc-testing, abandoned [View on SkillFed](https://skillfed.io/packages/pytest-grpc) · [View on PyPI](https://pypi.org/project/pytest-grpc/)