This kata complements Clean Code: Fundamentals, Ep. 2 - Names++.
The goal of this kata is to refactor the ChangeItForMe class methods for better variable names,
structure, and readability. You cannot change the signatures of the class methods or tests.
Setup is complete when the existing test suite passes.
Required:
Optional:
- GNU Make, for shorter commands. Every required task also
has a direct
uvcommand.
You do not need to install Python or pytest separately. uv installs a compatible Python version
and the locked project dependencies when needed.
-
Clone the repository:
git clone https://github.com/Coding-Cuddles/change-refactoring-python-kata.git -
Enter the repository directory:
cd change-refactoring-python-kata -
Run the existing tests. Use Make when it is installed:
make testOtherwise, run pytest through
uvdirectly:uv run pytestThe first run may install Python and the project dependencies. Setup is complete when pytest reports
2 passed.If the command fails with
uv: command not found, install uv and repeat this step.
Refactor change.py without changing the public method signatures or the tests in
test_change.py.
Run the tests after each change. Use Make when it is installed:
make testOtherwise, run pytest through uv directly:
uv run pytestContinue when the test run passes.
Make is optional. Run make or make help to list these commands in the terminal.
| Command | Result |
|---|---|
make all |
Run the test suite |
make help |
Show the command reference |
make test |
Run the test suite |
make format |
Format tracked Python files |
make format-check |
Check formatting without changing files |
make clean |
Remove generated caches |