$npx skillfedfor your agent

Pytest Domain Model Testing

This skill teaches you to thoroughly test domain layer code using pytest, covering value object validation and immutability, entity identity and business logic, and domain invariants. Learn patterns for reaching 95%+ coverage on pure domain models without external dependencies or mocks.

Pytest Domain Model Testing helps you test domain models and business logic effectively using pytest framework.

AI-generated summary based on this skill's SKILL.md

1 0 unlicensed, metadata onlyupdated by dawiddutoit

Decision gist · record as of 2026-01-26

Pytest Domain Model Testing helps you test domain models and business logic effectively using pytest framework. This skill teaches you to thoroughly test domain layer code using pytest, covering value object validation and immutability, entity identity and business logic, and domain invariants. Learn patterns for reaching 95%+ coverage on pure domain models without external dependencies or mocks.

manual: git clone https://github.com/dawiddutoit/custom-claude → cp -r custom-claude ~/.claude/skills/pytest-domain-model-testing

Use it when

  • Pytest Domain Model Testing provides patterns for domain-driven design testing including entity identity verification.
  • Pytest Domain Model Testing guides you through writing unit tests for domain entities and aggregates by focusing on business logic.
Same gist for agents: .md · .json

Install

dawiddutoit/custom-claude/pytest-domain-model-testing · repository language: Python

generated, unverified - the skill's exact subdirectory could not be determined; check the repository on GitHub

Open directory. Skills are indexed for reading, not audited. Review a skill's body before installing it.

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How to test domain models with pytest?

Pytest Domain Model Testing teaches you to build comprehensive test suites for your domain layer using pytest. Start by organizing tests around domain entities and value objects, writing pure unit tests that validate business logic without external dependencies. Use pytest fixtures to set up reusable domain objects, then write assertions that verify entity identity, value object immutability, and domain invariants. The skill covers patterns for reaching 95%+ coverage on pure domain models.

What patterns does Pytest Domain Model Testing cover for DDD?

Pytest Domain Model Testing provides patterns for domain-driven design testing including entity identity verification, value object validation and immutability checks, and domain invariant enforcement. Learn how to structure test fixtures for domain layer testing, implement domain model validation assertions, and write unit tests for domain entities and aggregates without mocks or external dependencies.

How do I test domain entities and aggregates with pytest?

Pytest Domain Model Testing guides you through writing unit tests for domain entities and aggregates by focusing on business logic validation. Create fixtures that instantiate domain objects consistently, then write assertions that verify entity behavior, aggregate invariants, and state transitions. The skill emphasizes testing pure domain logic in isolation, ensuring your domain models maintain their contracts and business rules.

What is domain model validation in Pytest Domain Model Testing?

Domain model validation in Pytest Domain Model Testing involves implementing assertions that verify your domain objects enforce their business rules. Test that value objects remain immutable, entities maintain identity correctly, and aggregates preserve their invariants. Learn to structure validation tests so they catch violations early and document your domain's constraints through executable test cases.

How do I set up test fixtures for domain layer testing?

Pytest Domain Model Testing teaches fixture setup for domain layer testing by creating reusable, well-organized domain object builders. Define pytest fixtures that construct valid domain entities and value objects with sensible defaults, then customize them in individual tests. This approach reduces boilerplate, improves test readability, and ensures consistent domain object creation across your test suite.

Can Pytest Domain Model Testing help me reach high coverage?

Yes. Pytest Domain Model Testing is designed to help you achieve 95%+ coverage on pure domain models by focusing on thorough business logic testing without external dependencies or mocks. The skill teaches you to identify all domain invariants and edge cases, then write targeted unit tests that exercise each path through your domain code.

Let your AI agent find skills like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 56,283 agent skills by what they can do, searchable in plain language.

wish › “Test domain models and business logic using pytest framework”

Give your agent the search over MCP, or paste the wish link into any chat. No install? Search from any chat →

Related skills

Pytest Test Data Factories
by dawiddutoit · dawiddutoit/custom-claude

This skill teaches patterns for building maintainable test data in pytest through factory functions, builder patterns, and fixture factories. Learn to eliminate test data duplication by providing sensible defaults and easy customization for domain objects, complex structures, and parameterized datasets.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
Pytest Type Safety
by dawiddutoit · dawiddutoit/custom-claude

Add type annotations to test functions and fixtures, then configure mypy to validate them during test runs. Use create_autospec for type-safe mocks that enforce interface contracts and catch typos at runtime.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
Pytest Configuration
by dawiddutoit · dawiddutoit/custom-claude

Set up pytest with production-ready configuration patterns covering test discovery, async support, custom markers, and coverage reporting. Includes conftest.py hierarchy examples and fixture scoping strategies for consistent test behavior across environments.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
Pytest Mocking Strategy
by dawiddutoit · dawiddutoit/custom-claude

Learn a decision-driven framework for mocking in pytest that separates external boundaries from business logic. This skill covers autospec enforcement, async mock patterns, reusable mock factories, and a clear matrix for what to mock versus what to test directly. Master the golden rule—mock external dependencies, test the unit in isolation—to write tests that survive refactoring.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
Pytest Adapter Integration Testing
by dawiddutoit · dawiddutoit/custom-claude

Master testing strategies for adapters connecting to external systems. Learn when to mock HTTP responses with aioresponses, spin up real services with testcontainers, and handle error paths in Kafka and other integrations.

no license declared → metadata onlyupdated Jan 2026
★ 1repo stars
odoo-test
by ahmed-lakosha · ahmed-lakosha/odoo-plugins

odoo-test provides a complete testing framework for Odoo development, generating test skeletons from model definitions, running test suites with tag filtering, and identifying coverage gaps. It supports multiple test class types—TransactionCase for ORM logic, HttpCase for routes and UI, and SavepointCase for exception handling—plus 20+ mock data generators and Azure DevOps CI/CD integration.

MITupdated Mar 2026
★ 71repo stars

More skills Pytest Application Layer Testing (unlicensed) · architecture-patterns (MIT)

Tags
domain-driven-designunit-testingtest-patternsbusiness-logicmodel-validationaggregate-testingddd-frameworktest-fixturesentity-testingbehavioral-testing