otherwise it causes sides effects since logging state is global and should only be done when __name__ == '__main__'. We can capture logging messages via the caplog pytest fixture