{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/6"},{"label":"Database","url":"https://skillfed.io/packages/category/database/5"}],"enrichment":{"capability":"A pytest plugin that provides fixtures for running tests against temporary, auto-cleaned PostgreSQL databases, with support for time freezing and common database operations.","skillfed_tags":["database-testing","test-fixtures","postgres"],"use_cases":["Unit testing ORM code that requires a real database without manual setup or teardown between tests.","Testing time-dependent database logic by freezing and advancing time within test blocks.","Loading test data from CSV files or SQL scripts into a clean database for each test run.","Testing PostgreSQL extension availability and installation within test fixtures.","Verifying schema and table creation logic in database migration or initialization code."],"what_it_does":"pytest-pgsql is a pytest plugin that automates database fixture management for tests that need PostgreSQL. It provides two main fixtures\u2014postgresql_db and transacted_postgresql_db\u2014each exposing a SQLAlchemy session and either an engine or connection object. The plugin automatically creates a fresh temporary database for each test and cleans it up afterward, ensuring test isolation without manual teardown.\n\nThe package integrates freezegun for time manipulation within tests, allowing you to freeze and advance time in both Python and the database. It also provides utility methods for common test setup tasks: loading CSV files into tables, executing SQL scripts with variable binding, managing PostgreSQL extensions, and creating schemas and tables from SQLAlchemy definitions. Both fixtures rely on testing.postgresql to handle temporary instance provisioning.","worth_installing":"Yes, with conditions. The package is stable and production-ready for projects that need isolated PostgreSQL test databases. However, adopt it only if you can accept that maintenance is minimal\u2014the last release was 2020-05-13, and there is no active development roadmap. Verify compatibility with your PostgreSQL version and Python version before committing, and monitor the repository for any breaking changes in dependencies like testing.postgresql."},"id":"pytest-pgsql","links":{"html":"https://skillfed.io/packages/pytest-pgsql","md":"https://skillfed.io/packages/pytest-pgsql.md","pypi":"https://pypi.org/project/pytest-pgsql/"},"maintenance":{"status":"aging"},"meta":{"latest_release":"2020-05-13","license_spdx":null,"license_treatment":"permissive","name":"pytest-pgsql","python_support":"unspecified","summary":"Pytest plugins and helpers for tests using a Postgres database."},"popularity":{"monthly_downloads":85357,"position":13928,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.1.2"}
