{"categories":[{"label":"Testing","url":"https://skillfed.io/packages/category/software-development-testing/3"},{"label":"Quality Assurance","url":"https://skillfed.io/packages/category/software-development-quality-assurance/2"}],"enrichment":{"capability":"testscenarios extends Python's unittest to run a single test method across multiple scenarios by injecting parameters as test attributes, enabling interface testing and dependency injection patterns.","skillfed_tags":["unittest-extension","parameterization","interface-testing"],"use_cases":["Testing multiple implementations of the same interface by defining scenarios for each backend or provider.","Running the same test suite against different configurations (e.g., database engines, network transports) without code duplication.","Plugin systems where a plugin needs to run standard interface tests against its own implementation.","Dependency injection: providing tests with externally-configured objects or settings to test behavior in different contexts.","Generating test variants dynamically based on available libraries or registry entries at test load time."],"what_it_does":"testscenarios is a unittest extension that enables clean dependency injection and parameterization of tests through scenarios. A scenario is a named tuple pairing a string identifier with a dictionary of parameters; the package multiplies a single test method across all scenarios, cloning the test and injecting each scenario's parameters as attributes on the test instance.\n\nThe package addresses a key limitation of unittest: running the same test logic against multiple implementations or configurations without creating brittle mixin-based subclasses. It supports three integration patterns: subclassing TestWithScenarios (most robust, works with any unittest-compliant runner), manual generation via generate_scenarios(), or hooking into test loader conventions like load_tests. Scenarios can be static class attributes or dynamically generated at runtime, and can be composed across multiple dimensions to create cross-product test expansion.","worth_installing":"Yes. testscenarios is a mature, actively maintained library with no security vulnerabilities, low install friction, and permissive dual licensing. It solves a genuine unittest limitation for interface and parameterized testing. Install if you need to run the same test logic across multiple scenarios or implementations without creating brittle subclass hierarchies."},"id":"testscenarios","links":{"html":"https://skillfed.io/packages/testscenarios","md":"https://skillfed.io/packages/testscenarios.md","pypi":"https://pypi.org/project/testscenarios/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-05-22","license_spdx":null,"license_treatment":"permissive","name":"testscenarios","python_support":"supports_current","summary":"Testscenarios, a unittest extension for dependency injection"},"popularity":{"monthly_downloads":443005,"position":6631,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"0.6.2"}
