summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2020-01-12 14:41:20 -0800
committerEric N. Vander Weele <ericvw@gmail.com>2020-01-12 23:19:26 -0500
commit153032f778d609b206cbfdb56ddf27e6f46925c4 (patch)
treebd6daf52e4e2b0b67d20c3f484bc63ee17072bff /tests/unit
parent24c2693979612f1178c444bc991beaed58933a20 (diff)
downloadflake8-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.py17
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', [])