Python module to make testing easier, it can generate random data like names and text, run commands, fetch urls, create files and directories, and more
with testdata.capture() as c:
logger.info("this wasn't captured")
And the reason why is because testdata's logging capture logic is only messing with StreamHandlers that have stdout and stderr streams, I think this can be modified to capture all StreamHandlers and just assume stream handlers will always go to a print stream.
Or it can be expanded to just capture anything that is logged including being logged to a file or whatever, which might make more sense.
In the new Captain code I have stderr and stdout logging streams that are wrapped by my custom Stream class, something like this:
But this didn't work as expected:
And the reason why is because testdata's logging capture logic is only messing with StreamHandlers that have stdout and stderr streams, I think this can be modified to capture all StreamHandlers and just assume stream handlers will always go to a print stream.
Or it can be expanded to just capture anything that is logged including being logged to a file or whatever, which might make more sense.