{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/5"}],"enrichment":{"capability":"Provides mock helpers for SQLAlchemy sessions in unit tests, enabling assertion on query calls and filter operations without accessing a real database.","skillfed_tags":["sqlalchemy-testing","mock-helpers"],"use_cases":["Assert that your code calls session.query() and filter() with the correct model and conditions during unit tests.","Stub test data by matching specific query and filter call sequences, returning different results for different filter combinations.","Verify that add() and delete() operations are called on the session without running actual database migrations.","Test query logic in isolation by mocking the session layer and checking filter expressions are built correctly."],"what_it_does":"mock-alchemy wraps SQLAlchemy's session object with mock helpers that let you assert on query and filter calls during unit tests without touching a real database. It provides three main tools: ExpressionMatcher for comparing SQLAlchemy binary expressions, AlchemyMagicMock for basic session mocking, and UnifiedAlchemyMagicMock for more complex scenarios where a session is queried multiple times with different filters. The library also supports stubbing real data by query criteria and partially fakes session mutations like add() and delete().\n\nThe package is lightweight\u2014it depends only on SQLAlchemy\u2014and installs as a pure Python wheel. However, it has been dormant since early 2023, with no recent commits or releases, so it may not track the latest SQLAlchemy API changes. It is classified as Pre-Alpha and is best suited for teams already committed to its design patterns.","worth_installing":"Yes, if you are already using SQLAlchemy and need to mock sessions in unit tests without database access. The low install friction and permissive license make it straightforward to adopt. However, be aware that maintenance is dormant\u2014last release was 2023-03-26\u2014so compatibility with very recent SQLAlchemy versions is uncertain. Test against your specific SQLAlchemy version before relying on it in production test suites."},"id":"mock-alchemy","links":{"html":"https://skillfed.io/packages/mock-alchemy","md":"https://skillfed.io/packages/mock-alchemy.md","pypi":"https://pypi.org/project/mock-alchemy/"},"maintenance":{"status":"dormant"},"meta":{"latest_release":"2023-03-26","license_spdx":null,"license_treatment":"permissive","name":"mock-alchemy","python_support":"supports_current","summary":"SQLAlchemy mock helpers."},"popularity":{"monthly_downloads":152987,"position":10890,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.2.6"}
