Skip to content

test: make pytest runnable without manual PYTHONPATH, fix stale asser… - #101

Merged
Joltras merged 1 commit into
devfrom
fix/test-infrastructure
Sep 11, 2026
Merged

test: make pytest runnable without manual PYTHONPATH, fix stale asser…#101
Joltras merged 1 commit into
devfrom
fix/test-infrastructure

Conversation

@Joltras

@Joltras Joltras commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

pytest previously required PYTHONPATH=src (only set in the Dockerfile) to even collect the test modules, and nothing enforced it, so pytest failed outright from a plain checkout. Add pyproject.toml pytest config that puts src on the path and add pytest to requirements.txt.

Also update three tests that had drifted from the implementation:

  • test_room_types expected 7 room types, RoomType now has 8 (SECRET_ROOM)
  • test_room_colors referenced the removed globals.Room_Colors instead of the current utils.room_type.room_colors
  • test_to_json's expected string predates the "_seed" field in Floor.to_json

Proposed changes

Describe the big picture of your changes here to communicate to the maintainers why we should accept this pull request.
If it fixes a bug or resolves a feature request, be sure to link to that issue.

Types of changes

What types of changes does your code introduce to this project?
Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update (if none of the other choices apply)

…tions

pytest previously required PYTHONPATH=src (only set in the Dockerfile) to
even collect the test modules, and nothing enforced it, so `pytest` failed
outright from a plain checkout. Add pyproject.toml pytest config that puts
src on the path and add pytest to requirements.txt.

Also update three tests that had drifted from the implementation:
- test_room_types expected 7 room types, RoomType now has 8 (SECRET_ROOM)
- test_room_colors referenced the removed globals.Room_Colors instead of
  the current utils.room_type.room_colors
- test_to_json's expected string predates the "_seed" field in
  Floor.to_json

globals_test.py::test_path is left failing on purpose - it's tracking a
real bug in APPLICATION_PATH (Windows-only path stripping) to be fixed in
a follow-up branch.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013qzxv6dWjnaUYoVpG8pQ58
@Joltras Joltras self-assigned this Sep 11, 2026
@Joltras
Joltras merged commit 828ace9 into dev Sep 11, 2026
2 checks passed
@Joltras
Joltras deleted the fix/test-infrastructure branch September 11, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant