uv-pytest-unit-testing

Set up and run pytest for uv projects and workspaces.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/gaelic-ghost/python-skills --skill uv-pytest-unit-testing
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: uv-pytest-unit-testing
Source: https://github.com/gaelic-ghost/python-skills/tree/main/uv-pytest-unit-testing
Command: npx skills add https://github.com/gaelic-ghost/python-skills --skill uv-pytest-unit-testing

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires uv, rg, pytest, pytest-cov, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

Streamline and standardize pytest setup and execution for uv-managed Python repositories, enabling consistent test runs across root projects and uv workspaces.

Core Features & Use Cases

  • Bootstrap pytest dependencies and baseline config with the bootstrap_pytest_uv.sh script.
  • Run tests at the repository root or targeted workspace packages using uv run with optional --package.
  • Enable optional coverage reporting via pytest-cov and manage configuration through pyproject.toml and layered profiles.
  • Organize tests with fixtures, markers, and parametrization, and troubleshoot discovery & import issues with guided steps.

Quick Start

Bootstrap pytest for uv projects by running the bootstrap_pytest_uv.sh script at the repository root, then run tests with uv run for root projects or uv run --package <member> for workspace packages.

Frequently Asked Questions about uv-pytest-unit-testing

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

FAQPage Schema
How do I set up and run pytest in a uv workspace?▼

To set up and run pytest in a uv workspace, use the bootstrap_pytest_uv.sh script for initial configuration, then execute tests with uv run --package <member> for targeted package testing. This standardizes test execution across workspace members.

What is the best way to standardize pytest configuration across uv projects?▼

Standardizing pytest configuration across uv projects is achieved by managing settings through pyproject.toml [tool.pytest.ini_options] and applying layered customization profiles, ensuring consistent test runs and setup via bootstrap_pytest_uv.sh.

Can I generate coverage reports with pytest in a uv project?▼

Yes, you can generate coverage reports in a uv project by enabling optional pytest-cov integration. Coverage reporting runs alongside standard test execution using uv run, providing metrics directly within your standardized workflow.

Do I need uv and pytest installed before bootstrapping my test environment?▼

Yes, you need uv and pytest installed as dependencies, with rg and pytest-cov as optional requirements. The bootstrap_pytest_uv.sh script configures the baseline environment using these prerequisites to establish your testing setup.

How does pytest test discovery work for individual packages in a uv workspace?▼

Pytest test discovery for individual packages in a uv workspace works by executing uv run --package <member> to scope test runs. It supports organizing tests with fixtures, markers, and parametrization for targeted execution.

Why are my pytest imports failing when running tests with uv?▼

Failing pytest imports when running tests with uv often stem from workspace configuration issues. Troubleshoot discovery and import errors by verifying your pyproject.toml setup and using guided steps to ensure correct package scoping.