Add hook to suspend/resume capturing
Currently there are several places where this gets done manually:
https://github.com/pytest-dev/pytest/blob/85288b53218d4e0037dce9c34bd37f86fa9e212d/src/_pytest/debugging.py#L253-L260
https://github.com/pytest-dev/pytest/blob/85288b53218d4e0037dce9c34bd37f86fa9e212d/src/_pytest/doctest.py#L206-L217
https://github.com/pytest-dev/pytest/blob/85288b53218d4e0037dce9c34bd37f86fa9e212d/src/_pytest/setuponly.py#L47-L51 (this one is not display out/err)
https://github.com/pytest-dev/pytest/blob/85288b53218d4e0037dce9c34bd37f86fa9e212d/src/_pytest/debugging.py#L180-L192
I think it might be good to use a hook / hooks for this instead.
The idea comes via the debugging plugin, where capman would suspend/resume on the enter_pdb and leave_pdb hooks from there - but it seems like it makes more sense to have this more generic then.
i believe we are looking for "api" here not "hook" - ideally we provide something in the capture plug-in that takes config and does the rest,
do you have something in mind/pseudo code?
No, I've meant hook - the capman/capture plugin would be the reference implementation then, but e.g. some other plugin could also react/handle it, e.g. the debugging plugin.
then i don't follow wrt the intended structure, do you have an minimal example that outlines the control flow that's intended?
Hey I was gonna do this manually but since it was marked as completed, could you direct me towards any changes that were made to address this?
it was closed without addressing, lets create a new issue with a workable solution