Skip to content

Conversation

@gltanaka
Copy link
Contributor

@gltanaka gltanaka commented Jan 4, 2026

Summary

Adds a failing test that detects the bug reported in #232.

Test File

tests/test_issue_232_reproduction.py

What This PR Contains

  • Failing unit test that reproduces the reported bug
  • Test is verified to fail on current code and will pass once the bug is fixed

Tests Included

  1. test_issue_232_only_test_file_modified_should_not_print_code_file - FAILS (detects the bug)
  2. test_issue_232_only_code_file_modified_should_not_print_test_file - FAILS (detects symmetrical bug)
  3. test_both_files_modified_should_print_both_paths - PASSES (positive case)

Root Cause

The bug is in pdd/fix_main.py at lines 418-423. When pdd fix completes successfully, the output messaging unconditionally prints both "Test file:" and "Code file:" paths, even when only one file was modified.

The file-saving logic (lines 387-397) correctly uses if fixed_unit_test: and if fixed_code: before writing files, but the output messaging doesn't follow the same pattern.

Next Steps

  1. Implement the fix at the identified location (pdd/fix_main.py:418-423)
  2. Add conditional checks to only print file paths when the corresponding content is non-empty
  3. Verify the test passes
  4. Run full test suite
  5. Mark PR as ready for review

Fixes #232


Generated by PDD agentic bug workflow

…paths

Add reproduction tests that detect the bug where `pdd fix` incorrectly
prints both Test file and Code file paths even when only one was modified.

Tests included:
- test_issue_232_only_test_file_modified_should_not_print_code_file (FAILS)
- test_issue_232_only_code_file_modified_should_not_print_test_file (FAILS)
- test_both_files_modified_should_print_both_paths (PASSES)

Bug location: pdd/fix_main.py:418-423

Relates to #232

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <[email protected]>
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.

pdd fix incorrectly prints the name of an output code file when no new code file was generated

2 participants