← ClaudeAtlas

test-validity-checkerlisted

This skill should be used when the user asks to "check tests", "validate tests", "review test quality", "verify test coverage", or when writing test files or running pytest. Ensures tests are meaningful.
smicolon/ai-kit · ★ 3 · AI & Automation · score 64
Install: claude install-skill smicolon/ai-kit
# Test Validity Checker Auto-validates that tests are meaningful and catch real bugs. ## Activation Triggers This skill activates when: - Writing test files - Before pytest execution - When test coverage is checked - When dev loop is running ## Validity Checks ### Check 1: Empty Test Detection ```python # INVALID - Empty body def test_user(): pass # INVALID - Only setup, no assertions def test_create(): user = create_user() # No assertions! # VALID def test_user_creation(): user = create_user() assert user.id is not None assert user.is_active ``` **Action**: Flag empty tests, require assertions ### Check 2: Trivial Assertion Detection ```python # INVALID - Always passes def test_always_passes(): assert True def test_truthy(): user = create_user() assert user # Just checks existence # INVALID - Testing constants def test_constant(): assert 1 + 1 == 2 # VALID - Tests actual behavior def test_user_email_lowercase(): user = create_user(email='TEST@Example.COM') assert user.email == 'test@example.com' ``` **Action**: Require value comparisons, not just truthiness ### Check 3: Assertion Count ```python # WEAK - Only 1 assertion def test_single_assertion(): response = client.get('/api/users/') assert response.status_code == 200 # STRONG - Multiple assertions def test_list_users(): response = client.get('/api/users/') assert response.status_code == 200 assert 'results' in response.data assert l