{"enrichment":{"faq":[{"a":"python-testing-patterns teaches you to write pytest tests by organizing test functions with clear naming conventions (test_* prefix), using the AAA pattern (Arrange, Act, Assert), and structuring assertions with descriptive messages. Start with simple unit tests that verify single behaviors, then progress to fixtures for setup/teardown and parameterization for testing multiple input scenarios efficiently.","q":"How to write pytest tests in Python?"},{"a":"python-testing-patterns covers pytest fixtures as reusable test components that handle setup and teardown automatically. Fixtures use the @pytest.fixture decorator and can yield values to tests or clean up resources afterward. The skill explains scope levels (function, class, module, session), dependency injection patterns, and how conftest.py enables sharing fixtures across test files.","q":"What are pytest fixtures and how do setup/teardown work?"},{"a":"python-testing-patterns demonstrates mocking external dependencies using unittest.mock and pytest plugins. Learn to replace real API calls, database connections, and services with controlled mock objects, verify mock interactions with assert_called_with, and use monkeypatch for environment variables and module attributes. This isolates tests from external systems.","q":"How do you mock external dependencies in Python unit tests?"},{"a":"python-testing-patterns explains TDD as writing tests before implementation code, following the red-green-refactor cycle. Start by writing a failing test, implement minimal code to pass it, then refactor. This skill shows how TDD improves design, catches bugs early, and creates living documentation through comprehensive test coverage.","q":"What is test-driven development (TDD) and how to implement it?"},{"a":"python-testing-patterns covers async testing using pytest-asyncio for coroutines, fixtures with async setup, and testing SQLAlchemy operations with in-memory databases or fixtures. Learn integration testing patterns for database transactions, rollback strategies, and how to test async/await workflows alongside synchronous code.","q":"How can you test async code and database operations with pytest?"},{"a":"python-testing-patterns teaches coverage measurement using pytest-cov to identify untested code paths, interpret coverage reports, and set quality gates. The skill explains coverage limitations, strategies for meaningful metrics beyond percentages, and how to use parametrized tests and property-based testing with Hypothesis to strengthen test suites.","q":"How do you measure code coverage and improve test quality?"}],"shadow_tags":["test-automation","quality-assurance","code-coverage","dependency-mocking","test-infrastructure","behavior-verification","continuous-integration","test-isolation"],"summary_rewrite":"Learn to structure Python tests using pytest, fixtures, parameterization, and mocking techniques. This skill covers unit and integration testing, test isolation, the AAA pattern, and debugging strategies to establish reliable test infrastructure."},"files":[{"bytes":21664,"path":"plugins/python-development/skills/python-testing-patterns/SKILL.md","sha256":"3b6b5b1d9fbd34eb45664ab54978716a264322b03c42b1a188f24d874b8ee854","url":"https://skillfed.io/files/HermeticOrmus/LibreUIUX-Claude-Code/python-testing-patterns/1dd4ab03/SKILL.md"}],"id":"HermeticOrmus/LibreUIUX-Claude-Code/python-testing-patterns","links":{"html":"https://skillfed.io/HermeticOrmus/LibreUIUX-Claude-Code/python-testing-patterns","md":"https://skillfed.io/HermeticOrmus/LibreUIUX-Claude-Code/python-testing-patterns.md","repo":"https://github.com/HermeticOrmus/LibreUIUX-Claude-Code"},"meta":{"agents_supported":[],"first_seen":"2026-07-28","forks":12,"language":"Shell","last_updated":"2026-05-27","license":"MIT","name":"python-testing-patterns","publisher":"HermeticOrmus","stars":86},"relations":{"similar":[{"id":"xu-xiang/everything-claude-code-zh/python-testing"},{"id":"manutej/luxor-claude-marketplace/pytest-patterns"},{"id":"affaan-m/ECC/python-testing"},{"id":"LambdaTest/agent-skills/pytest-skill"},{"id":"bobmatnyc/claude-mpm-skills/pytest"},{"id":"pluginagentmarketplace/custom-plugin-python/pytest-testing"},{"id":"NickCrew/Claude-Cortex/python-testing-patterns"},{"id":"JosiahSiegel/claude-plugin-marketplace/python-testing"},{"id":"martinholovsky/claude-skills-generator/mcp"},{"id":"Gentleman-Programming/Gentleman-Skills/pytest"}]},"slug":{"owner":"HermeticOrmus","repo":"LibreUIUX-Claude-Code","skill":"python-testing-patterns"},"version":"1dd4ab03"}
