コード例 #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)
コード例 #2
0
def log_capture():
    set_debug(True)

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

        assert (debug._DEBUG_ENABLED == False)
コード例 #4
0
    def test_set_debug_enabled(self):
        debug._DEBUG_ENABLED = False
        set_debug(True)

        assert (debug._DEBUG_ENABLED == True)