The edit → restart → test → commit loop, plus testing and commit conventions.
cd C:\Users\Play\Documents\Projects\space-game
python main.py
taskkill /f /im python.exe 2>nul || true
python run_tests.py
python main.py
Test in-game — verify the feature/fix works by interacting with it. In-game testing catches issues automated tests miss.
Example loop: edit ship.py to improve autopilot braking → kill running
game → start fresh → target station and land → verify smooth braking without
overshoot → commit “Improve: Refine autopilot braking distance calculation”.
python run_tests.py
Discovers tests/test_*.py. Coverage is split across themed modules
(test_flight_physics.py, test_routines.py, test_missions.py,
test_location_screen.py, test_space_screen.py, test_ui.py, test_dialogue.py,
test_possessions.py, test_persistence.py, test_graphics_audio.py,
test_config.py, test_misc.py); shared setup (pygame mock, imports, _FakeFont)
is in tests/harness.py, imported by each module via from tests.harness import *.
Highlights:
test_misc.py) — _handle_scrolling_input(),
_list_files_by_pattern(), _center_text_x().TestAutopilotPhysics) — drives a real Ship through
engage_seek() + ship.update() toward a real LandingSite, one case per
ship_types.json preset, asserting it lands, arrives close, stops, and
doesn’t oscillate. This is a smoke test, not a substitute for the
AUTOPILOT_TESTING.md battery.test_location_screen.py, TestStationInteriorLayout) — walks a real path across
Alpha Station and fails if a furniture/structure placement pinches it shut.Keep the bar practical: test regressions you’ve actually seen or critical
paths. Don’t test UI rendering or pygame drawing. Prefer testing a new pure
physics helper as a method on the class that owns it (the way
TestAutopilotPhysics does), rather than a standalone physics module.
How: add the case to the themed tests/test_*.py module that fits (or a new
one — discovery picks up any test_*.py), run python run_tests.py, commit the
test with the feature/fix.
[Feature/Fix] Brief description
- Bullet points of changes
- One per line
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Prefixes seen in history: Feature:, Fix:, Improve:, controls: (when a
keyboard binding changed — see CONTROLS.md), pipeline: (asset
pipeline / design JSON — see GRAPHICS_PIPELINE.md).
Only commit or push when the user asks.