--- id: testing-postgresql version: "1.3.0" license: Apache License 2.0 license_treatment: permissive maintenance: abandoned --- # testing.postgresql — automatically setups a postgresql instance in a temporary directory, and destroys it after testing License: permissive · Maintenance: abandoned · Downloads: 4.5M/mo ## What it is and what it does testing.postgresql is a test fixture library that spawns isolated PostgreSQL instances in temporary directories for the duration of a test run, then cleans them up automatically. It wraps the PostgreSQL command-line tools (initdb and postgres) to create fresh databases on demand, eliminating the need to manage shared test databases or mock database connections. The package provides two main patterns: direct instantiation via Postgresql() for simple per-test isolation, or PostgresqlFactory with caching to reuse an initialized database schema across multiple tests, reducing setup overhead. It integrates with standard unittest patterns and supports passing connection details to database drivers via url() or dsn() methods. Use it for: - Unit tests that need real PostgreSQL behavior without a shared test database. - Integration tests that require schema fixtures and data isolation between test cases. - CI/CD pipelines where PostgreSQL must be provisioned and torn down per test run. - Development workflows testing database migrations or schema changes in isolation. - Parameterized tests that each need a fresh database state without manual setup code. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Automatically creates and tears down temporary PostgreSQL instances for testing, handling setup and cleanup without manual intervention. No. The package is abandoned (latest release 2016-02-04) and targets Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5—all end-of-life versions. Modern Python and PostgreSQL compatibility are untested. For new projects, consider actively maintained alternatives. ## Install pip install testing-postgresql uv add testing-postgresql poetry add testing-postgresql ## Installing testing.postgresql Before you install: Low install friction with a pure-Python wheel distribution. However, the package is abandoned as of 2016 with no updates since its latest release, and its last commit was in 2023. The codebase targets Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, all of which are end-of-life; compatibility with modern Python versions is unverified. License in practice: Licensed under Apache License 2.0, a permissive license that allows commercial and private use with minimal restrictions. No licensing barrier to adoption. Quickstart: import testing.postgresql with testing.postgresql.Postgresql() as postgresql: # connect using postgresql.url() or postgresql.dsn() # run tests PostgreSQL server binaries (initdb, postgres) must be present in your PATH; the package does not bundle them. Verify before relying: - Compatibility with Python versions beyond 3.5 is not documented. - Whether the package works with modern PostgreSQL versions is unclear. - Current state of the testing.common.database dependency introduced in 1.3.0. - Whether pg8000 1.10 dependency remains compatible with current environments. ## Package facts - License: Apache License 2.0 (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 4.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags postgresql test fixtures, temporary database for testing, automated postgres setup, postgres test isolation, database testing utilities, ephemeral postgres instances, database-testing, test-fixtures, abandoned [View on SkillFed](https://skillfed.io/packages/testing-postgresql) · [View on PyPI](https://pypi.org/project/testing-postgresql/)