$npx skillfedfor your agent

testgres

Testing utility for PostgreSQL and its extensions

With conditionsPyPI LibrariesReleased Aug 2026101.2K downloads / moPostgreSQLPure Python

Decision gist · record as of 2026-08-14

pure-Python wheel — testgres-1.15.2-py3-none-any.whl
v1.15.2 · released 2026-08-04 · Python >=3.7.3 · 6 runtime deps: pg8000, port-for, six, psutil, packaging, testgres.os_ops

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—verify 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.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires PostgreSQL binaries (initdb, pg_ctl, psql) in PATH or accessible via PG_CONFIG or PG_BIN environment variable; supports Python 3.7.3 and newer.
  • Low install friction with a pure-Python wheel and six runtime dependencies.
  • Active maintenance with a release 10 days ago and commits through August 2026; the project has 157 stars and no known vulnerabilities.

License · maintenance · safety

PostgreSQL (unclear) — Licensed under PostgreSQL (license_treatment: unclear). The PostgreSQL license is permissive but differs from common open-source licenses; verify compatibility with your project's licensing requirements before adopting.

last release 2026-08-04 (10 days) · last repo commit 2026-08-04 · 157 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 101,216 downloads/mo, #12,953 on PyPI

Verify before relying

pip install testgres

import testgres

with testgres.get_new_node() as node:
    node.init()
    node.start()
    result = node.execute('select 1')
    print(result)
  • Whether the PostgreSQL license (license_treatment: unclear) is compatible with your project's licensing model.
  • Performance characteristics when running many parallel test nodes (documentation mentions pytest-xdist but does not quantify overhead).
Same gist for agents: .md · .json

What it is and 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—initialization, startup, query execution, and cleanup—so 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.

It 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.

Use it for

  • 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.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

With conditions

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—verify 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.

Install

testgres on PyPI

Before you install

Low install friction with a pure-Python wheel and six runtime dependencies. Active maintenance with a release 10 days ago and commits through August 2026; the project has 157 stars and no known vulnerabilities.

Requires PostgreSQL binaries (initdb, pg_ctl, psql) in PATH or accessible via PG_CONFIG or PG_BIN environment variable; supports Python 3.7.3 and newer.

License in practice

Licensed under PostgreSQL (license_treatment: unclear). The PostgreSQL license is permissive but differs from common open-source licenses; verify compatibility with your project's licensing requirements before adopting.

Quickstart

pip install testgres

import testgres

with testgres.get_new_node() as node:
    node.init()
    node.start()
    result = node.execute('select 1')
    print(result)

Verify before relying

  • Whether the PostgreSQL license (license_treatment: unclear) is compatible with your project's licensing model.
  • Performance characteristics when running many parallel test nodes (documentation mentions pytest-xdist but does not quantify overhead).

Package facts

LicensePostgreSQL unclear
Python supportSupports the current Python release >=3.7.3
Install frictionLow. Pure-Python wheel
Runtime dependencies
6 packages
pg8000port-forsixpsutilpackagingtestgres.os_ops
MaintenanceActively maintained 10 days since the last release
Last repo commit
First released
Downloads101,216 / month, #12,953 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Intended Audience :: DevelopersOperating System :: UnixProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: Software Development :: Testing

Evidence: testgres-1.15.2-py3-none-any.whl

Tags

Capabilities
postgresql test cluster setuptemporary postgres database testingpytest postgresql fixturespostgres node orchestrationtest database provisioningpostgresql integration testingephemeral postgres instances
Topics
postgres-testingtest-fixturesdatabase-provisioning
PyPI keywords
testtestingpostgresql

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 › “postgresql test cluster setup”

  • testgrestestgres orchestrates temporary PostgreSQL clusters for Python tests,…
  • patroniPatroni orchestrates PostgreSQL high-availability clusters using…
  • testing.postgresqlAutomatically creates and tears down temporary PostgreSQL instances…

Give your agent the search over MCP, or paste the wish link into any chat.

More Libraries packages

urllib3 Worth it
PyPI · Libraries · released May 2026

urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.

MITpure Python · 3.10+
1.8Bdownloads / mo
requests Worth it
PyPI · Libraries · released May 2026

Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.

Apache-2.0pure Python · 3.10+
1.8Bdownloads / mo
pluggy Worth it
PyPI · Libraries · released May 2025

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.

MITpure Python · 3.9+aging
1.3Bdownloads / mo
python-dateutil Worth it
PyPI · Libraries · released Mar 2024

Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.

Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.

Apache-2.0pure Python
1.2Bdownloads / mo
six With conditions
PyPI · Libraries · released Dec 2024

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.

MITpure Python
1.2Bdownloads / mo
pytest Worth it
PyPI · Libraries · released Jun 2026

pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.

MITpure Python · 3.10+
1.1Bdownloads / mo

See also testing.postgresql · pytest-pgsql · pytest-postgresql · postgres · testing.common.database · patroni · pgdb · testcontainers-postgres · py-pglite · pgserver