Add failing tests for #493: update --output subdirectory crash#496
Merged
gltanaka merged 4 commits intopromptdriven:mainfrom Feb 16, 2026
Merged
Add failing tests for #493: update --output subdirectory crash#496gltanaka merged 4 commits intopromptdriven:mainfrom
gltanaka merged 4 commits intopromptdriven:mainfrom
Conversation
…n#493) Unit test and E2E test that reproduce the NameError when using pdd update with --output flag on a code file in a subdirectory. context_config is only defined in the else branch but used unconditionally at line 91. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds regression coverage for issue #493 where pdd update --output crashes when the target code file lives in a subdirectory, and includes the minimal fix to prevent the context_config scoping error.
Changes:
- Add unit tests covering
resolve_prompt_code_pair()with/without--outputand with root/subdirectory code paths. - Add an E2E regression test exercising
update_main()with--output+ subdirectory code file. - Initialize
context_config = {}before branching onoutput_dirto avoidUnboundLocalError.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tests/test_update_main.py | Adds unit regression tests for resolve_prompt_code_pair() covering the reported crash scenario. |
| tests/test_e2e_issue_493_update_output_subdir.py | Adds an integration-level test to reproduce issue #493 via update_main() with --output. |
| pdd/update_main.py | Fixes scoping by initializing context_config before it’s used in subdirectory path logic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Remove unused imports (os, pytest) from e2e test - Replace hardcoded line number references with descriptive text in docstrings - Use Path.is_relative_to() instead of fragile substring check for path assertion - Fix missing newline at EOF in test_update_main.py Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
|
please fix the CI failures |
1bc3dd6 to
535bc71
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds failing tests that detect the bug reported in #493.
Test Files
tests/test_update_main.pytests/test_e2e_issue_493_update_output_subdir.pyWhat This PR Contains
Root Cause
context_configis only defined in theelsebranch (line 75 ofupdate_main.py) but used unconditionally at line 91 when the code file is in a subdirectory. Fix: initializecontext_config = {}before the if/else block.Next Steps
context_config = {}before the if/else block)Fixes #493
Generated by PDD agentic bug workflow