tavern
Simple testing of RESTful APIs
Decision gist · record as of 2026-08-14
Yes. Tavern is actively maintained, has no known vulnerabilities, and solves a real problem—making API tests readable and maintainable. The YAML syntax is genuinely easier to write and review than Python test code for straightforward cases, and the pytest integration means you don't sacrifice tooling or ecosystem. Low install friction and permissive licensing add no friction. Best for teams that value test readability and want to keep API tests in version control as documentation.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.11 or later.
- Best used with pytest; standalone CLI tool tavern-ci available but pytest integration is the recommended path.
- Low install friction with a pure-Python wheel distribution.
License · maintenance · safety
permissive license (permissive) — Permissive license (MIT) means you can use, modify, and distribute Tavern freely in commercial and private projects without restriction.
last release 2026-06-14 (61 days) · last repo commit 2026-08-05 · 1,153 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 267,069 downloads/mo, #8,297 on PyPI
Alternatives
Verify before relying
pip install tavern[pytest]
# Create test_api.tavern.yaml:
# ---
# test_name: Test API endpoint
# stages:
# - name: GET request
# request:
# url: https://api.example.com/data
# method: GET
# response:
# status_code: 200
pytest test_api.tavern.yaml -v- Whether the 10 runtime dependencies are all required for basic use or if some are optional for specific features.
- Performance characteristics when testing high-volume or long-running API test suites.
- Extent of custom Python validation function support and how it compares to other frameworks.
What it is and what it does
Tavern lets you write API tests in plain YAML files that pytest can discover and run alongside your other tests. Instead of writing Python code for each API call and assertion, you declare the request (URL, method, headers, body) and the expected response (status code, JSON structure) in a readable, version-controllable format. It integrates directly with pytest, so you get all of pytest's reporting, plugins, and CI/CD tooling for free.
The package supports testing REST APIs, MQTT message brokers, and gRPC services in the same test file. You can use pytest fixtures and hooks to extend tests, write custom validation functions in Python when YAML isn't expressive enough, and organize tests with pytest marks. It ships as a pytest plugin (auto-discovered on install), a standalone command-line tool (tavern-ci) for shell scripts, and a Python library for programmatic use.
Use it for
- Write and maintain API contract tests in version control as YAML files that non-developers can read and modify.
- Run API tests in CI/CD pipelines against staging or test servers, integrated with pytest's reporting and failure notifications.
- Test MQTT brokers and gRPC services alongside REST APIs in a single test suite without switching frameworks.
- Validate JSON response structure and values using jmespath and jsonschema without writing custom Python assertions.
- Extend tests with Python fixtures and custom validation functions for complex scenarios while keeping simple tests declarative.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
Tavern is actively maintained, has no known vulnerabilities, and solves a real problem—making API tests readable and maintainable. The YAML syntax is genuinely easier to write and review than Python test code for straightforward cases, and the pytest integration means you don't sacrifice tooling or ecosystem. Low install friction and permissive licensing add no friction. Best for teams that value test readability and want to keep API tests in version control as documentation.
Install
tavern on PyPI
Before you install
Low install friction with a pure-Python wheel distribution. Active maintenance with a recent release (61 days ago) and ongoing commits. Depends on 10 runtime packages including pytest, requests, and validation libraries—all standard, well-maintained tools.
Requires Python 3.11 or later. Best used with pytest; standalone CLI tool tavern-ci available but pytest integration is the recommended path.
License in practice
Permissive license (MIT) means you can use, modify, and distribute Tavern freely in commercial and private projects without restriction.
Quickstart
pip install tavern[pytest]
# Create test_api.tavern.yaml:
# ---
# test_name: Test API endpoint
# stages:
# - name: GET request
# request:
# url: https://api.example.com/data
# method: GET
# response:
# status_code: 200
pytest test_api.tavern.yaml -v
Verify before relying
- Whether the 10 runtime dependencies are all required for basic use or if some are optional for specific features.
- Performance characteristics when testing high-volume or long-running API test suites.
- Extent of custom Python validation function support and how it compares to other frameworks.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release >=3.11 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 10 packagesPyYAMLjmespathjsonschemapyjwtpykwalifypytestpython-boxrequestssimpleevalstevedore |
| Maintenance | Actively maintained 61 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 267,069 / month, #8,297 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableFramework :: PytestIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Topic :: Software Development :: TestingTopic :: Utilities |
Evidence: tavern-3.6.1-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “api testing yaml”
- tavernTavern is a pytest plugin and command-line tool for automated testing…
- openapi-spec-validatorValidates OpenAPI specifications (versions 2.0, 3.0, 3.1, and 3.2)…
- pytest-mypy-pluginsA pytest plugin that runs type-checking tests against mypy by…
Give your agent the search over MCP, or paste the wish link into any chat.
More Utilities packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Detects and normalizes text encoding from unknown or ambiguous sources, supporting all IANA character sets that Python's core library provides codecs for, with the ability to register custom codecs.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Pygments is a syntax highlighter that colorizes source code and text in over 500 languages and formats, outputting to HTML, LaTeX, RTF, SVG, images, or ANSI terminal sequences.
Install it if you need to display or transform source code.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
See also grpcio-testing · pytest-only · pytest-playwright-asyncio · pytest-cache · pytest-grpc · pytest-pretty · pytest-pep8 · qase-python-commons · pytest-playwright · pytest-regressions