likkisai59/spond/unit-testing

Claude Code and agent skill by likkisai59/spond

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Unit testing patterns for FastAPI with pytest, pytest-asyncio, and async test clients

Install

npx vskill@latest install likkisai59/spond/unit-testing

SKILL.md

The same SKILL.md was published earlier as likkisai59/spond/unit-testing.

Unit Testing Skill

Installation

bash
pip install pytest==8.3.*
pip install pytest-asyncio==0.25.*
pip install httpx # For AsyncClient testing

Test Configuration

python
# pytest.ini
[pytest]
asyncio_mode = auto
testpaths = tests

Fixtures (conftest.py)

python
import pytest
import pytest_asyncio
from httpx import AsyncClient, ASGITransport
from app.main import app
@pytest_asyncio.fixture
async def client():
async with AsyncClient(
transport=ASGITransport(app=app),
base_url="http://test"
) as ac:
yield ac
@pytest_asyncio.fixture
async def auth_headers():
token = create_test_jwt(user_id="test123")
return {"Authorization": f"Bearer {token}"}

Test Patterns

python
@pytest.mark.asyncio
async def test_create_order(client, auth_headers):
response = await client.post(
"/api/v1/orders",
json={"user_id": "test", "item_id": "item1", "amount": 100},
headers=auth_headers
)
assert response.status_code == 201
@pytest.mark.asyncio
async def test_unauthorized(client):
response = await client.get("/api/v1/orders")
assert response.status_code == 401

Best Practices

  1. Use pytest-asyncio for async tests
  2. Rollback database changes after each test
  3. Mock external services (Razorpay, SES)
  4. Use descriptive test names
  5. Test both success and error cases

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
5

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/likkisai59/spond/unit-testing/badge)](https://verified-skill.com/skills/likkisai59/spond/unit-testing)

Something wrong with this skill or its page? Tell us.