{"categories":[{"label":"Libraries","url":"https://skillfed.io/packages/category/software-development-libraries/9"},{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/6"}],"enrichment":{"capability":"testgres orchestrates temporary PostgreSQL clusters for Python tests, handling initialization, startup, query execution, and automatic cleanup.","skillfed_tags":["postgres-testing","test-fixtures","database-provisioning"],"use_cases":["Run integration tests against a fresh PostgreSQL instance that is created, used, and destroyed within a single test function or fixture.","Test PostgreSQL extensions or custom configurations by provisioning nodes with specific postgresql.conf settings via default_conf() and append_conf().","Verify replication and backup workflows by creating a master node, taking backups, spawning replicas, and asserting catchup behavior.","Execute quick performance benchmarks using pgbench through testgres in a controlled, repeatable test environment.","Parallelize test suites across multiple isolated PostgreSQL nodes using pytest-xdist, with each node on a distinct port."],"what_it_does":"testgres is a test utility that spins up isolated, temporary PostgreSQL clusters for use in Python test suites. It handles the full lifecycle\u2014initialization, startup, query execution, and cleanup\u2014so tests can focus on logic rather than database provisioning. The package wraps PostgreSQL command-line tools (initdb, pg_ctl, psql) and provides Python bindings for common operations like executing queries, managing transactions, creating backups, spawning replicas, and running pgbench benchmarks.\n\nIt integrates with pytest via fixtures and the standard Python logging module, making it straightforward to aggregate logs from multiple test nodes. The package supports both local and remote (Linux-only) node provisioning via SSH, and provides sensible configuration defaults that can be customized. With six runtime dependencies (pg8000, port-for, six, psutil, packaging, and testgres.os_ops) and low install friction, it is designed to be dropped into existing test suites with minimal setup overhead.","worth_installing":"Yes, if you need to test PostgreSQL-dependent code in isolation. The package is actively maintained, has no known vulnerabilities, and low install friction. The main caveat is the unclear PostgreSQL license treatment\u2014verify it aligns with your project's licensing before committing. The blocker is a working PostgreSQL installation; if you already have one, testgres is a straightforward way to automate cluster provisioning in tests."},"id":"testgres","links":{"html":"https://skillfed.io/packages/testgres","md":"https://skillfed.io/packages/testgres.md","pypi":"https://pypi.org/project/testgres/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-08-04","license_spdx":null,"license_treatment":"unclear","name":"testgres","python_support":"supports_current","summary":"Testing utility for PostgreSQL and its extensions"},"popularity":{"monthly_downloads":101216,"position":12953,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.15.2"}
