Add flake8 comprehensions checks to pre-commit & CI (#48111)

This commit is contained in:
Franck Nijhof 2021-03-19 13:41:09 +01:00 committed by GitHub
parent fa5ce70af1
commit 8a56dbf587
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 27 additions and 29 deletions

View file

@ -766,7 +766,7 @@ class MockConfigEntry(config_entries.ConfigEntry):
def patch_yaml_files(files_dict, endswith=True):
"""Patch load_yaml with a dictionary of yaml files."""
# match using endswith, start search with longest string
matchlist = sorted(list(files_dict.keys()), key=len) if endswith else []
matchlist = sorted(files_dict.keys(), key=len) if endswith else []
def mock_open_f(fname, **_):
"""Mock open() in the yaml module, used by load_yaml."""