What are Resources?
Resources in Merit are like pytest fixtures - they provide reusable dependencies for your tests. Use them for:- Database connections
- API clients
- Test data
- Expensive model loading
- Configuration
Basic Resource
Define a resource with the@merit.resource decorator:
Resource Dependencies
Resources can depend on other resources:Async Resources
Resources can be async:Resource Teardown
Useyield for resources that need cleanup:
Resource Scope
Control how often resources are created:"test"(default) - New instance for each test"suite"- One instance per test file