test-coverage

Generate unit, integration, and contract tests for Scrapy spiders, pipelines, and middlewares.

2|2|Updated Nov 4, 2025
One-click install
npx skills add https://github.com/gizix/cc_projects --skill test-coverage-gizix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: test-coverage
Source: https://github.com/gizix/cc_projects/tree/main/scrapy-template/.claude/skills/test-coverage
Command: npx skills add https://github.com/gizix/cc_projects --skill test-coverage-gizix

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps you design and generate thorough test suites for Scrapy spiders, pipelines, and middlewares with fixtures and mocking.

Core Features & Use Cases

  • Test Types: Unit, integration, and contract tests aligned with Scrapy and pytest best practices.
  • Fixtures & Mocking: Structured fixtures and mocks to ensure reliable tests.
  • Coverage Targets: Guidance to reach desired coverage thresholds.

Quick Start

Create a basic test module for a spider and run pytest to verify behavior and coverage.

Frequently Asked Questions about test-coverage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate comprehensive test suites for Scrapy spiders?

Generate comprehensive test suites for Scrapy spiders by creating unit, integration, and contract tests using pytest with structured fixtures and mocks. The Skill guides you through spider, pipeline, and middleware testing with realistic data, fixture-driven workflows, and coverage reporting to validate behavior reliably.

What's the best way to set up test fixtures and mocking for Scrapy projects?

Set up test fixtures and mocking by configuring pytest.ini and Scrapy test settings to enable repeatable, scalable testing. Structured fixtures isolate spider, pipeline, and middleware components while mocks simulate external dependencies, ensuring reliable unit and integration tests across your Scrapy project.

How can I achieve high test coverage for Scrapy pipelines and middlewares?

Achieve high test coverage for Scrapy pipelines and middlewares by writing unit and integration tests that exercise all component paths using pytest and fixtures. Coverage reporting guidance helps you identify gaps and reach desired thresholds across spider, pipeline, and middleware logic.

Do I need pytest configuration to test Scrapy components effectively?

Yes, pytest configuration (pytest.ini) and Scrapy test settings are required to enable repeatable, scalable testing. These prerequisites establish the test environment, fixture discovery, and coverage reporting needed for unit, integration, and contract tests across spiders, pipelines, and middlewares.

What's the difference between unit, integration, and contract tests for Scrapy?

Unit tests verify individual spider, pipeline, or middleware functions in isolation; integration tests validate component interactions; contract tests ensure Scrapy component contracts are met. This Skill covers all three types using pytest fixtures and mocking to achieve comprehensive coverage aligned with Scrapy best practices.

Can I use this approach to test custom Scrapy middlewares alongside spiders?

Yes, this Skill generates test suites for spiders, pipelines, and middlewares together. Fixture-driven workflows and mocking support testing custom middlewares alongside spiders and pipelines, with realistic data and coverage reporting to validate all component interactions.