Skip to content

Allow debugger interactions in tests#3235

Merged
Rowlando13 merged 1 commit intopallets:stablefrom
kdeldycke:fix-clirunner-debugger
Apr 11, 2026
Merged

Allow debugger interactions in tests#3235
Rowlando13 merged 1 commit intopallets:stablefrom
kdeldycke:fix-clirunner-debugger

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

@kdeldycke kdeldycke commented Feb 28, 2026

This PR patches CliRunner to allow pdb interactions in tests.

CliRunner captures stdout, which breaks pdb.set_trace() and interactive debuggers. You can't debug inside an invoked command because stdout is redirected.

By playing nice with pdb in Click tests, we can improve the experience of developers and maintainers, and as a far reaching goal, maybe improve bug reporting from the community.

This PR:

@kdeldycke kdeldycke changed the title Patch pdb in CliRunner to allow debugger interactions in tests Allow debugger interactions in tests Feb 28, 2026
@kdeldycke kdeldycke added bug f:test runner feature: cli test runner labels Feb 28, 2026
@kdeldycke kdeldycke added this to the 8.3.2 milestone Feb 28, 2026
@kdeldycke kdeldycke force-pushed the fix-clirunner-debugger branch 2 times, most recently from 2e1a7d7 to c040895 Compare February 28, 2026 13:00
@Rowlando13 Rowlando13 modified the milestones: 8.3.2, 8.3.3 Mar 15, 2026
@kdeldycke kdeldycke force-pushed the fix-clirunner-debugger branch 2 times, most recently from 3271451 to a8cff32 Compare April 9, 2026 14:06
@kdeldycke kdeldycke force-pushed the fix-clirunner-debugger branch from a8cff32 to 4f9086b Compare April 9, 2026 14:23
@Rowlando13 Rowlando13 merged commit ac2dd7a into pallets:stable Apr 11, 2026
13 checks passed
@kdeldycke kdeldycke linked an issue Apr 11, 2026 that may be closed by this pull request
@kdeldycke kdeldycke deleted the fix-clirunner-debugger branch April 11, 2026 09:49
@kdeldycke
Copy link
Copy Markdown
Collaborator Author

Thanks @Rowlando13 for the merge! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:test runner feature: cli test runner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

click.testing.CliRunner.invoke prevents use of pdb

2 participants