# pytest-dev/pytest-testinfra

Testinfra test your infrastructures

Repository: https://github.com/pytest-dev/pytest-testinfra
Canonical: https://ross.abutalabs.com/products/pytest-testinfra
Homepage: https://testinfra.readthedocs.io
Language: Python
License: Apache-2.0
License Family: permissive
Topics: python, testing, infrastructure-as-code, devops, tdd, nagios, docker, tdd-utilities, testing-tools, devops-tools, infrastructure-testing, saltstack, chef, puppet, ansible, kubernetes, pytest-plugin
Last push: 2026-07-20T20:32:30+00:00

## Health v2 (maintenance only)
Score: 76/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 93, release rhythm 40, longevity 100
- inputs: {"age_days": 4189, "days_push": 44, "days_rel": 521, "gap_med": 0.0, "n_releases_24m": 3}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2477, forks 359 (observed 2026-08-28T04:06:55.071967+00:00)

## What it is
Testinfra is a pytest plugin for writing unit tests in Python that verify the actual state of servers managed by tools like Ansible, Salt, Puppet, and Chef. It is the Python equivalent of Serverspec, letting you assert on files, packages, and services across your infrastructure.

## Use cases
- verify server configuration with pytest tests
- test ansible playbooks actually applied the right state
- check that nginx is installed and running on my servers
- assert file permissions and contents on remote hosts
- run infrastructure tests against docker containers
- replace serverspec with a python-based tool
- use infrastructure tests in ci/cd pipelines

## When to choose
- you use pytest and want infrastructure verification in Python
- you manage servers with Ansible, Salt, Puppet, or Chef and need state assertions
- you want a Serverspec-like tool in the Python ecosystem

## When to avoid
- you need a project with active maintenance and fast issue responses
- you prefer behavior testing over state testing
- you need a non-Python test stack

## Facets
- artifact type: library
- maturity: maintenance
- function: testing, infrastructure-as-code, configuration-management
- domain: testing, infrastructure-as-code
- platform: python, cli
- tags: pytest-plugin, serverspec-equivalent, infrastructure-testing, ansible, saltstack, chef, puppet, tdd, devops, automation, linux, docker, kubernetes

## Member repositories
- pytest-dev/pytest-testinfra (main) score 76

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:06:55.071967+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T02:28:20.223139+00:00, confidence not recorded.
  - readme: https://github.com/pytest-dev/pytest-testinfra (fetched 2026-08-28T04:06:55.071967+00:00, sha 2229ba0be432)
- Data as of 2026-08-30T08:39:29.467469+00:00.
