def test_log_debug_disabled(self, log_capture): set_debug(False) log('foo') logs = log_capture.actual() # Only log should be the one notifying that logging is being disabled assert (len(logs) == 1)
def log_capture(): set_debug(True) with LogCapture() as capture: yield capture
def test_set_debug_disabled(self): debug._DEBUG_ENABLED = True set_debug(False) assert (debug._DEBUG_ENABLED == False)
def test_set_debug_enabled(self): debug._DEBUG_ENABLED = False set_debug(True) assert (debug._DEBUG_ENABLED == True)