diff options
author | Florian Bruhin <me@the-compiler.org> | 2021-12-02 18:02:25 +0100 |
---|---|---|
committer | Florian Bruhin <me@the-compiler.org> | 2021-12-03 12:04:59 +0100 |
commit | 4d13280994d9b476256861b93efabad55880bd64 (patch) | |
tree | fdfdf144ae693242a92a8e39528930e1e94d2d07 /tests/unit | |
parent | 1ca68e6280f44493e0976f3535ae765dd2b6c90e (diff) | |
download | qutebrowser-4d13280994d9b476256861b93efabad55880bd64.tar.gz qutebrowser-4d13280994d9b476256861b93efabad55880bd64.zip |
pylint: Fix some legitimate issues
Diffstat (limited to 'tests/unit')
-rw-r--r-- | tests/unit/components/test_hostblock.py | 2 | ||||
-rw-r--r-- | tests/unit/utils/test_log.py | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/tests/unit/components/test_hostblock.py b/tests/unit/components/test_hostblock.py index 6a71058ea..5949f92f8 100644 --- a/tests/unit/components/test_hostblock.py +++ b/tests/unit/components/test_hostblock.py @@ -427,7 +427,7 @@ def test_invalid_utf8(config_stub, tmp_path, caplog, host_blocker_factory, locat with caplog.at_level(logging.ERROR): current_download.successful = True current_download.finished.emit() - expected = r"Failed to decode: " r"b'https://www.example.org/\xa0localhost" + expected = r"Failed to decode: b'https://www.example.org/\xa0localhost" assert caplog.messages[-2].startswith(expected) else: current_download.successful = True diff --git a/tests/unit/utils/test_log.py b/tests/unit/utils/test_log.py index 7682c1156..7b0f5293e 100644 --- a/tests/unit/utils/test_log.py +++ b/tests/unit/utils/test_log.py @@ -53,8 +53,7 @@ def restore_loggers(): saved_level_to_name = logging._levelToName.copy() logger_states = {} for name in saved_loggers: - logger_states[name] = getattr(saved_loggers[name], 'disabled', - None) + logger_states[name] = getattr(saved_loggers[name], 'disabled', None) finally: logging._releaseLock() @@ -86,9 +85,9 @@ def restore_loggers(): logger_dict = logging.getLogger().manager.loggerDict logger_dict.clear() logger_dict.update(saved_loggers) - for name in logger_states: - if logger_states[name] is not None: - saved_loggers[name].disabled = logger_states[name] + for name, state in logger_states.items(): + if state is not None: + saved_loggers[name].disabled = state finally: logging._releaseLock() |