mirror of
https://github.com/borgmatic-collective/borgmatic.git
synced 2026-07-22 02:03:01 +02:00
Fix shadowing of built-in function (#1331).
This commit is contained in:
+3
-3
@@ -380,9 +380,9 @@ def remove_log_exclude_filter(name):
|
||||
Given a unique filter name, remove matching filters from each log handler.
|
||||
'''
|
||||
for handler in logging.getLogger().handlers:
|
||||
for filter in handler.filters:
|
||||
if getattr(filter, 'name', None) == name:
|
||||
handler.removeFilter(filter)
|
||||
for exclude_filter in handler.filters:
|
||||
if getattr(exclude_filter, 'name', None) == name:
|
||||
handler.removeFilter(exclude_filter)
|
||||
|
||||
|
||||
class Logs_suppressed:
|
||||
|
||||
@@ -435,21 +435,21 @@ def test_log_prefix_sets_prefix_and_then_restores_original_prefix_after():
|
||||
|
||||
|
||||
def test_log_exclude_filter_filter_omits_log_matching_any_attributes():
|
||||
filter = module.Log_exclude_filter('my filter', {'foo': 'bar', 'baz': 'quux'})
|
||||
exclude_filter = module.Log_exclude_filter('my filter', {'foo': 'bar', 'baz': 'quux'})
|
||||
|
||||
assert filter.filter(flexmock(foo='nope', baz='quux')) is False
|
||||
assert exclude_filter.filter(flexmock(foo='nope', baz='quux')) is False
|
||||
|
||||
|
||||
def test_log_exclude_filter_filter_includes_log_matching_no_attributes():
|
||||
filter = module.Log_exclude_filter('my filter', {'foo': 'bar', 'baz': 'quux'})
|
||||
exclude_filter = module.Log_exclude_filter('my filter', {'foo': 'bar', 'baz': 'quux'})
|
||||
|
||||
assert filter.filter(flexmock(foo='nope', baz='uh uh')) is True
|
||||
assert exclude_filter.filter(flexmock(foo='nope', baz='uh uh')) is True
|
||||
|
||||
|
||||
def test_log_exclude_filter_filter_includes_log_matching_no_attributes_and_in_fact_missing_them_entirely():
|
||||
filter = module.Log_exclude_filter('my filter', {'foo': 'bar', 'baz': 'quux'})
|
||||
exclude_filter = module.Log_exclude_filter('my filter', {'foo': 'bar', 'baz': 'quux'})
|
||||
|
||||
assert filter.filter(flexmock(other='nope', thing='uh uh')) is True
|
||||
assert exclude_filter.filter(flexmock(other='nope', thing='uh uh')) is True
|
||||
|
||||
|
||||
def test_add_log_exclude_filter_adds_filter_to_each_handler():
|
||||
|
||||
Reference in New Issue
Block a user