diff options
| author | Eric N. Vander Weele <ericvw@gmail.com> | 2020-01-12 14:41:20 -0800 |
|---|---|---|
| committer | Eric N. Vander Weele <ericvw@gmail.com> | 2020-01-12 23:19:26 -0500 |
| commit | 153032f778d609b206cbfdb56ddf27e6f46925c4 (patch) | |
| tree | bd6daf52e4e2b0b67d20c3f484bc63ee17072bff /tests/unit | |
| parent | 24c2693979612f1178c444bc991beaed58933a20 (diff) | |
| download | flake8-153032f778d609b206cbfdb56ddf27e6f46925c4.tar.gz | |
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.
Diffstat (limited to 'tests/unit')
| -rw-r--r-- | tests/unit/test_config_file_finder.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/unit/test_config_file_finder.py b/tests/unit/test_config_file_finder.py index d03118a..93d515a 100644 --- a/tests/unit/test_config_file_finder.py +++ b/tests/unit/test_config_file_finder.py @@ -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', []) |
