Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow for disabling output capture in SimpleTestResourceWrapper to allow using pdb in tests. #21

Open
riebecj opened this issue Jan 28, 2025 · 1 comment

Comments

@riebecj
Copy link

riebecj commented Jan 28, 2025

Currently, the SimpleTestResourceWrapper uses with self._debugging_output.capture_stdout_and_stderr() to capture stdout and stderr with no way to disable it. This prevents using pdb for test debugging because it's unable to pipe stdout/stderr. I have manually patched my sources by adding a capture: bool = False option in each of the resource hook functions, but it would be nice to have it supported with your intentional design input.

I could also fork and submit a PR, if needed.

@gchqdev227
Copy link
Member

Hi @riebecj, thank you for raising this, and for the detailed description.

The TestResourceWrapper subclasses are due an overhaul at some point in the future, but in the meantime I'd be happy for you to take a crack at fixing this specific issue, as it is definitely not the behaviour we want.

If you're able to hook it into TestResourceWrapper.capture_debugging to properly toggle the capturing in a way that works with pdb then that would be ideal, although I appreciate it might be difficult to change with the current implementation. Either way we'd welcome a PR.

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

No branches or pull requests

2 participants