I'm unable to get logging output from my unit tests and it looks like the reason is that all loggers except for the root logger have propagate set to false when I run pytest. I can run the following file, using pytest and python test_file.py. In the former logging.getLogger('one').propagate == True while in the latter logging.getLogger('one').propagate == False. Why is this?
test_file.py
import logging
def test_function():
print()
print('root', logging.getLogger().propagate)
print('one', logging.getLogger('one').propagate)
if __name__ == '__main__':
test_function()
How do I get all my loggers to propagate? Searching the internet only turns up questions about how to turn off propagation as if most people have the opposite experience that I do.