mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-06 21:16:54 +00:00
config: Remove ConfigFileFinder 'parent' and 'tail' attributes
These attributes are only needed within the `.generate_possible_local_files()` method. Therefore, just obtain the current working directory at the beginning of the method and reduce the lifetime state of the `ConfigFileFinder` object.
This commit is contained in:
parent
98d3d50295
commit
e887ef3317
2 changed files with 6 additions and 8 deletions
|
|
@ -61,11 +61,12 @@ def test_cli_config_double_read():
|
|||
])
|
||||
def test_generate_possible_local_files(cwd, expected):
|
||||
"""Verify generation of all possible config paths."""
|
||||
with mock.patch.object(os, 'getcwd', return_value=cwd):
|
||||
finder = config.ConfigFileFinder('flake8', [])
|
||||
finder = config.ConfigFileFinder('flake8', [])
|
||||
|
||||
assert (list(finder.generate_possible_local_files())
|
||||
== expected)
|
||||
with mock.patch.object(os, 'getcwd', return_value=cwd):
|
||||
config_files = list(finder.generate_possible_local_files())
|
||||
|
||||
assert config_files == expected
|
||||
|
||||
|
||||
@pytest.mark.parametrize('extra_config_files,expected', [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue