Loading...
Loading...
Test-driven development in Python using uv as the package manager. Covers the red-green-refactor cycle, vertical slicing, and uv project setup.
npx skill4agent add spencerpauly/awesome-cursor-skills python-tdd-with-uvuvuvuv --versionpyproject.tomluv inituv add --dev pytest pytest-covuv run pytest --coRED → Write ONE failing test for the next behavior
GREEN → Write the MINIMUM code to make it pass
REFACTOR → Clean up without changing behavior
REPEATuv run pytest# tests/test_<module>.py
class TestFeatureName:
"""Group related behaviors."""
def test_does_expected_thing_when_given_input(self):
result = function_under_test(input_value)
assert result == expected
def test_raises_when_given_invalid_input(self):
with pytest.raises(ValueError):
function_under_test(bad_input)uv run pytest # all tests
uv run pytest tests/test_foo.py # single file
uv run pytest -k "test_name" # by name pattern
uv run pytest --cov=src # with coverage
uv run pytest -x # stop on first failureuv add <package> # add dependency
uv add --dev <package> # add dev dependency
uv remove <package> # remove dependency
uv sync # sync environment from lockfile
uv run <command> # run in managed environment
uv lock # regenerate lockfileuv runpyproject.tomluv.lock