Is there any way to suppress (i.e. hide) the captured logging information block factory boy generates when a test fails or generates an error? I'm talking about this:
SomeError: you encountered an error
----------- >> begin captured loggin << -----------
... DEBUG information
----------- >> end captured loggin << -------------
---------------------------------------------------
Ran 1 test...
Often times, this information isn't relevant or necessary to solve the problem and it's just a lot of stuff I have to scroll up past to see what caused the error.
Thanks.
You can change the factory_boy logging level with:
import logging
logging.getLogger("factory").setLevel(logging.WARN)
Replacing WARN
with whatever level you want. I don't know where to put this in a Django environment, but you can put this in your test file or some global initializer.
This should suppress any logging except actual factory_boy errors & warnings.
Weird default, since factory_boy debugging is rarely helpful and is incredibly verbose.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With