예제 #1
0
def test_pdb_filtering(filter_strings, should_pdb, replaced_checkpoint,
                       exc_info, config_override):
    config_override('debug.enabled', True)
    config_override('debug.filter_strings', filter_strings)
    with slash.Session():
        debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called == should_pdb
예제 #2
0
def test_pdb_filtering_with_disabled_debug(replaced_checkpoint, exc_info,
                                           config_override):
    config_override('debug.enabled', False)
    config_override('debug.filter_strings', ['ZeroDivisionError'])
    with slash.Session():
        debug.debug_if_needed(exc_info)
    assert not replaced_checkpoint.called
예제 #3
0
def test_debug_if_needed_regular_exception(replaced_checkpoint, exc_info,
                                           debug_enabled):
    debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called
예제 #4
0
def test_debug_if_needed_not_called(replaced_checkpoint, skipped_exc_info,
                                    debug_enabled):
    debug.debug_if_needed(skipped_exc_info)
    assert not replaced_checkpoint.called
예제 #5
0
def test_debug_if_needed_regular_exception(replaced_checkpoint, exc_info,
                                           debug_enabled):  # pylint: disable=unused-argument
    with slash.Session():
        debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called
예제 #6
0
def test_debug_if_needed_not_called(replaced_checkpoint, skipped_exc_info,
                                    debug_enabled):  # pylint: disable=unused-argument
    with slash.Session():
        debug.debug_if_needed(skipped_exc_info)
    assert not replaced_checkpoint.called
예제 #7
0
def test_debug_if_needed_regular_exception(replaced_checkpoint, exc_info, debug_enabled):
    debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called
예제 #8
0
def test_debug_if_needed_not_called(replaced_checkpoint, skipped_exc_info, debug_enabled):
    debug.debug_if_needed(skipped_exc_info)
    assert not replaced_checkpoint.called
예제 #9
0
def test_debug_if_needed_without_session(exc_info, replaced_checkpoint):
    debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called
예제 #10
0
def test_debug_if_needed_not_called(replaced_checkpoint, skipped_exc_info):
    with slash.Session():
        debug.debug_if_needed(skipped_exc_info)
    assert not replaced_checkpoint.called
예제 #11
0
def test_debug_if_needed_regular_exception(replaced_checkpoint, exc_info):
    with slash.Session():
        debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called