--- id: testing-common-database version: "2.0.3" license: Apache License 2.0 license_treatment: permissive maintenance: abandoned --- # testing.common.database — utilities for testing.* packages License: permissive · Maintenance: abandoned · Downloads: 4.5M/mo ## What it is and what it does testing.common.database is a base-class library for building database testing frameworks. It provides a Database class that you subclass to define how to initialize, start, and check the health of a temporary database instance, plus a DatabaseFactory for managing multiple instances and caching initialized databases across test runs. It also includes utility decorators to skip tests when a database command is not found, and helpers like get_unused_port() and get_path_of() for locating free ports and executables. The package is designed to be inherited and extended, not used directly. You implement hooks like initialize_database(), get_server_commandline(), and is_server_available() to teach it how to manage your specific database. Once subclassed, you can use it as a context manager to spin up isolated database instances for each test, optionally caching the initialized state to avoid repeated setup overhead. Use it for: - Build a PostgreSQL testing framework by subclassing Database and implementing database-specific initialization and server-launch logic. - Create a test suite that spawns temporary database instances on unused ports, avoiding conflicts between parallel test runs. - Cache an initialized database schema across multiple tests to reduce per-test setup time while maintaining isolation. - Skip database-dependent tests when the database server executable is not found on the system. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides base classes and utilities for building database testing frameworks, allowing you to create isolated, temporary database instances for test suites. No. The package is abandoned (last release October 2017, last commit December 2021) and receives no maintenance or security updates. While it has low install friction and permissive licensing, it is a template library requiring substantial subclassing work, and there is no active support or modern alternatives documented. Use only if you are maintaining legacy code already depending on it; for new projects, evaluate actively maintained testing frameworks. ## Install pip install testing-common-database uv add testing-common-database poetry add testing-common-database ## Installing testing.common.database Before you install: Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2017-10-23 and last commit 2021-12-18—so it receives no active maintenance or security updates. License in practice: Licensed under Apache License 2.0 (permissive), so you may use, modify, and distribute it freely in commercial and private projects with minimal restrictions. Quickstart: pip install testing.common.database from testing.common.database import Database, DatabaseFactory class MyDatabase(Database): def initialize(self): pass def get_data_directory(self): return '/path/to/data' def get_server_commandline(self): return ['mydb', '--port', str(self.settings['port'])] You must implement abstract methods (initialize, get_data_directory, get_server_commandline, is_server_available) in your subclass; the base class is a template, not a ready-to-use tool. Verify before relying: - Whether the package works reliably with Python versions beyond 3.6 (classifiers list only up to 3.6; current Python is much newer). - Whether subprocess-based database spawning (used since 2.0.0) is stable on modern operating systems. - Real-world usage patterns and whether the caching and factory features work as documented in practice. ## 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 database testing utilities, temporary database for tests, database test fixtures, testing database framework, isolated database testing, database test harness, database-testing, test-fixtures, abandoned [View on SkillFed](https://skillfed.io/packages/testing-common-database) · [View on PyPI](https://pypi.org/project/testing-common-database/)