summaryrefslogtreecommitdiff
path: root/tests/unit
diff options
context:
space:
mode:
authorEric N. Vander Weele <ericvw@gmail.com>2020-01-20 12:50:33 -0500
committerEric N. Vander Weele <ericvw@gmail.com>2020-01-20 12:53:49 -0500
commit716db1167e32072f2e9c1b64ace7e769b53859cc (patch)
tree5f46ded41fe82021c3dd5d5170d0d2f2bed844c2 /tests/unit
parentd583f051ed8ef047693956670f991692b5749318 (diff)
downloadflake8-716db1167e32072f2e9c1b64ace7e769b53859cc.tar.gz
config: Remove checks for configs being previously parsed
Remove the checks to see if a configuration file has already been seen and parsed. These checks aren't necessary because the entire run of `flake8` calls these methods *only* once per configuration provided.
Diffstat (limited to 'tests/unit')
-rw-r--r--tests/unit/test_config_file_finder.py24
1 files changed, 0 insertions, 24 deletions
diff --git a/tests/unit/test_config_file_finder.py b/tests/unit/test_config_file_finder.py
index 797d58a..29aacd4 100644
--- a/tests/unit/test_config_file_finder.py
+++ b/tests/unit/test_config_file_finder.py
@@ -34,18 +34,6 @@ def test_cli_config():
assert parsed_config.has_section('flake8')
-def test_cli_config_double_read():
- """Second request for CLI config is cached."""
- finder = config.ConfigFileFinder('flake8')
-
- parsed_config = finder.cli_config(CLI_SPECIFIED_FILEPATH)
- boom = Exception("second request for CLI config not cached")
- with mock.patch.object(finder, '_read_config', side_effect=boom):
- parsed_config_2 = finder.cli_config(CLI_SPECIFIED_FILEPATH)
-
- assert parsed_config is parsed_config_2
-
-
@pytest.mark.parametrize('cwd,expected', [
# Root directory of project
(os.path.abspath('.'),
@@ -96,18 +84,6 @@ def test_local_configs():
assert isinstance(finder.local_configs(), configparser.RawConfigParser)
-def test_local_configs_double_read():
- """Second request for local configs is cached."""
- finder = config.ConfigFileFinder('flake8')
-
- first_read = finder.local_configs()
- boom = Exception("second request for local configs not cached")
- with mock.patch.object(finder, '_read_config', side_effect=boom):
- second_read = finder.local_configs()
-
- assert first_read is second_read
-
-
@pytest.mark.parametrize('files', [
[BROKEN_CONFIG_PATH],
[CLI_SPECIFIED_FILEPATH, BROKEN_CONFIG_PATH],