I am trying to use <caplog> in pytest to capture l...
# ask-community
I am trying to use caplog in pytest to capture logs when unit testing my IO manager but the caplog doesn't show anything from dagster (only vanilla python logging output) I tried using:
Copy code
with caplog.at_level(logging.DEBUG, logger="dagster.builtin"):
    manager.handle_output(context, obj)
But that doesn't capture anything. Is there something I am doing wrong / is there a way to inspect the dagster logs so I can assert some messages being logged?
hi @martin o leary -- I think using capsys and examining the stderr stream will yield better results here. You'll only get log messages flowing through the standard python logging stream when using
(this is circumvented when using
🙌 1
Brilliant @owen that did it thanks!!