Example #1
0
    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)
Example #2
0
def log_capture():
    set_debug(True)

    with LogCapture() as capture:
        yield capture
Example #3
0
    def test_set_debug_disabled(self):
        debug._DEBUG_ENABLED = True
        set_debug(False)

        assert (debug._DEBUG_ENABLED == False)
Example #4
0
    def test_set_debug_enabled(self):
        debug._DEBUG_ENABLED = False
        set_debug(True)

        assert (debug._DEBUG_ENABLED == True)