mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 13:06:53 +00:00
config: Add 'config_file' parameter to ConfigFileFinder
The `--config` flag is passed into `MergedConfigParser.parse()` and the module-level function `config.get_local_plugins()`. Since both of these places utilize the `ConfigFileFinder` object and the configuration file override pertains to how configuration behaves, this incremental change directly associates the `ConfigFileFinder` and the configuration file override.
This commit is contained in:
parent
24c2693979
commit
153032f778
3 changed files with 30 additions and 3 deletions
|
|
@ -127,6 +127,23 @@ def test_read_config_catches_decoding_errors(tmpdir):
|
|||
assert parsed == []
|
||||
|
||||
|
||||
def test_config_file_default_value():
|
||||
"""Verify the default 'config_file' attribute value."""
|
||||
finder = config.ConfigFileFinder('flake8', [])
|
||||
assert finder.config_file is None
|
||||
|
||||
|
||||
def test_setting_config_file_value():
|
||||
"""Verify the 'config_file' attribute matches constructed value."""
|
||||
config_file_value = 'flake8.ini'
|
||||
finder = config.ConfigFileFinder(
|
||||
'flake8',
|
||||
[],
|
||||
config_file=config_file_value,
|
||||
)
|
||||
assert finder.config_file == config_file_value
|
||||
|
||||
|
||||
def test_ignore_config_files_default_value():
|
||||
"""Verify the default 'ignore_config_files' attribute value."""
|
||||
finder = config.ConfigFileFinder('flake8', [])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue