mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-05 04:36:52 +00:00
Merge branch 'master' into 'master'
Remove filter by filename in utils.filenames_from Closes #382 See merge request pycqa/flake8!311
This commit is contained in:
commit
0d7247082e
2 changed files with 12 additions and 3 deletions
|
|
@ -180,6 +180,16 @@ def test_filenames_from_a_directory_with_a_predicate():
|
|||
assert 'flake8/__init__.py' not in filenames
|
||||
|
||||
|
||||
def test_filenames_from_a_directory_with_a_predicate_from_the_current_dir():
|
||||
"""Verify that predicates filter filenames_from."""
|
||||
filenames = list(utils.filenames_from(
|
||||
arg='./src/flake8',
|
||||
predicate=lambda filename: filename == '__init__.py',
|
||||
))
|
||||
assert len(filenames) > 2
|
||||
assert './src/flake8/__init__.py' in filenames
|
||||
|
||||
|
||||
def test_filenames_from_a_single_file():
|
||||
"""Verify that we simply yield that filename."""
|
||||
filenames = list(utils.filenames_from('flake8/__init__.py'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue