Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #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
Exemple #9
0
def test_debug_if_needed_without_session(exc_info, replaced_checkpoint):
    debug.debug_if_needed(exc_info)
    assert replaced_checkpoint.called
Exemple #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
Exemple #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