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
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
def test_debug_if_needed_regular_exception(replaced_checkpoint, exc_info, debug_enabled): debug.debug_if_needed(exc_info) assert replaced_checkpoint.called
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
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
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
def test_debug_if_needed_without_session(exc_info, replaced_checkpoint): debug.debug_if_needed(exc_info) assert replaced_checkpoint.called
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
def test_debug_if_needed_regular_exception(replaced_checkpoint, exc_info): with slash.Session(): debug.debug_if_needed(exc_info) assert replaced_checkpoint.called