mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-12 23:54:17 +00:00
config: Change ConfigFileFinder._read_config() to accept variadic args
This simplifies `._read_config()` by removing a conditional branch in the situation where it is called with one file to process. Now the contract accepts any number of arguments of the same type. Where callers invoke `._read_config()` with a `Sequence`, the call site has been changed to unpack arguments (i.e., `*`). The tests in `test_merged_config_parser.py` needed to return a string for the user configuration path instead of an empty list since `ConfigFileFinder.user_config_file()` returns a string.
This commit is contained in:
parent
20906d4304
commit
1a4060cd5f
3 changed files with 9 additions and 9 deletions
|
|
@ -113,7 +113,7 @@ def test_local_configs_double_read():
|
|||
])
|
||||
def test_read_config_catches_broken_config_files(files):
|
||||
"""Verify that we do not allow the exception to bubble up."""
|
||||
_, parsed = config.ConfigFileFinder._read_config(files)
|
||||
_, parsed = config.ConfigFileFinder._read_config(*files)
|
||||
assert BROKEN_CONFIG_PATH not in parsed
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue