sqlspec-testing

Guide SQLSpec test development with pytest-databases fixtures and pytest-xdist parallelism.

15|4|Updated Jan 20, 2026
One-click install
npx skills add https://github.com/cofin/flow --skill sqlspec-testing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sqlspec-testing
Source: https://github.com/cofin/flow/tree/main/skills/sqlspec-testing
Command: npx skills add https://github.com/cofin/flow --skill sqlspec-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides guidance and best practices for writing, organizing, and executing tests within the SQLSpec framework, ensuring robust and efficient testing.

Core Features & Use Cases

  • Testing Standards: Adheres to canonical testing rules and fixture patterns.
  • Fixture Management: Utilizes pytest-databases for service fixtures and session-scoped fixtures for efficiency.
  • Parallel Execution: Supports pytest-xdist for faster test runs.
  • Use Case: When developing new database adapter tests for SQLSpec, consult this Skill for the correct fixture setup and execution strategy.

Quick Start

Consult the SQLSpec testing guide for best practices on using pytest-databases fixtures.

Frequently Asked Questions about sqlspec-testing

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

FAQPage Schema
How do I set up pytest fixtures for database integration tests?

Database adapter tests in SQLSpec require session-scoped fixtures from pytest-databases for service management and function-based tests with integration test markers for proper organization. Use pytest-xdist for parallel execution.

What is the best way to organize pytest database tests for parallel execution?

Pytest-xdist enables parallel database test execution by combining function-based tests with integration test markers and session-scoped fixtures. This organization prevents conflicts and maximizes test run speed.

Does pytest-xdist work with session-scoped database fixtures?

Pytest-xdist works with session-scoped pytest-databases fixtures to enable parallel database test execution. Function-based tests with integration markers ensure isolation across distributed workers.

Why use session-scoped fixtures for database testing workflows?

Session-scoped pytest-databases fixtures prevent redundant service initialization, reducing overhead and ensuring consistent database states. Function-based tests with integration markers maintain isolation within the session.

How do I write function-based tests for SQLSpec database adapters?

Function-based tests for SQLSpec database adapters use pytest-databases session-scoped fixtures and integration test markers. This structure ensures proper isolation and adherence to canonical testing standards.

When should I use integration test markers in pytest database testing?

Use integration test markers when database tests require pytest-databases service fixtures and session-scoped setup. Markers categorize tests and ensure proper execution within the SQLSpec testing ecosystem.