# Jimmc414 Claude Code Plugin Marketplace Verify With Inline Tests

> verify-with-inline-tests

- Skill: `tomevault-io/jimmc414-claude-code-plugin-marketplace-verify-with-inline-t` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/jimmc414-claude-code-plugin-marketplace-verify-with-inline-t`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/jimmc414-claude-code-plugin-marketplace-verify-with-inline-t/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/jimmc414-claude-code-plugin-marketplace-verify-with-inline-t

---


# verify-with-inline-tests

## When to Use
- Tests should be near the code
- Tests serve as documentation
- Single-file modules
- Quick verification during development

## When NOT to Use
- Large test suites
- Need test isolation
- CI/CD expects tests in specific location

## The Pattern

Include tests in the module, run them when module is executed directly.

```python
def my_function(x):
    """Do something useful."""
    return x * 2

def test():
    """Run all tests."""
    assert my_function(2) == 4
    assert my_function(0) == 0
    assert my_function(-1) == -2
    print("All tests pass.")

if __name__ == '__main__':
    test()
```

## Example (from pytudes)

```python
# sudoku.py - structural invariant tests
def test():
    """A set of tests that must pass."""
    assert len(squares) == 81
    assert len(unitlist) == 27
    assert all(len(units[s]) == 3 for s in squares)
    assert all(len(peers[s]) == 20 for s in squares)
    assert units['C2'] == [
        ['A2', 'B2', 'C2', 'D2', 'E2', 'F2', 'G2', 'H2', 'I2'],
        ['C1', 'C2', 'C3', 'C4', 'C5', 'C6', 'C7', 'C8', 'C9'],
        ['A1', 'A2', 'A3', 'B1', 'B2', 'B3', 'C1', 'C2', 'C3']
    ]
    print('All tests pass.')

if __name__ == '__main__':
    test()
    solve_all(open("sudoku-easy50.txt"), "easy")
    solve_all(open("sudoku-top95.txt"), "hard")

# spell.py - comprehensive unit tests
def unit_tests():
    assert correction('speling') == 'spelling'
    assert correction('korrectud') == 'corrected'
    assert correction('bycycle') == 'bicycle'
    assert words('This is a TEST.') == ['this', 'is', 'a', 'test']
    assert len(WORDS) == 32198
    assert sum(WORDS.values()) == 1115585
    assert 0.07 < P('the') < 0.08
    return 'unit_tests pass'

if __name__ == '__main__':
    print(unit_tests())
    spelltest(Testset(open('spell-testset1.txt')))
```

## Key Principles
1. **`if __name__ == '__main__'`**: Only run tests when executed directly
2. **Assert for tests**: Simple, clear assertions
3. **Print success**: Confirm tests ran
4. **Test structure first**: Validate data structures built correctly
5. **Tests as examples**: Show how functions are used

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/jimmc414) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-13 -->

