mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 13:06:53 +00:00
config: Add 'ignore_config_files' parameter to ConfigFileFinder
The `--isolated` 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 isolation pertains to how the `ConfigFileFinder` should behave with respect to isolation, this incremental change more directly associates the `ConfigFileFinder` and configuration file isolate.
This commit is contained in:
parent
4395b05605
commit
a5c17c1a19
3 changed files with 32 additions and 3 deletions
|
|
@ -124,3 +124,23 @@ def test_read_config_catches_decoding_errors(tmpdir):
|
|||
setup_cfg.write_binary(b'[x]\ny = \x81\x8d\x90\x9d')
|
||||
_, parsed = config.ConfigFileFinder._read_config(setup_cfg.strpath)
|
||||
assert parsed == []
|
||||
|
||||
|
||||
def test_ignore_config_files_default_value():
|
||||
"""Verify the default 'ignore_config_files' attribute value."""
|
||||
finder = config.ConfigFileFinder('flake8', [])
|
||||
assert finder.ignore_config_files is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize('ignore_config_files_arg', [
|
||||
False,
|
||||
True,
|
||||
])
|
||||
def test_setting_ignore_config_files_value(ignore_config_files_arg):
|
||||
"""Verify the 'ignore_config_files' attribute matches constructed value."""
|
||||
finder = config.ConfigFileFinder(
|
||||
'flake8',
|
||||
[],
|
||||
ignore_config_files=ignore_config_files_arg
|
||||
)
|
||||
assert finder.ignore_config_files is ignore_config_files_arg
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue