mirror of
https://github.com/PyCQA/flake8.git
synced 2026-04-04 20:26:53 +00:00
Add and fix documentation
- Add more documentation around utils functions - Fix documentation about default formatting plugins - Add extra documentation of filenames_from predicate parameter - Add test for the default parameter of flake8.utils.fnmatch
This commit is contained in:
parent
cd18b9f175
commit
a4e984dbd2
5 changed files with 67 additions and 5 deletions
|
|
@ -64,6 +64,12 @@ def test_fnmatch(filename, patterns, expected):
|
|||
assert utils.fnmatch(filename, patterns) is expected
|
||||
|
||||
|
||||
def test_fnmatch_returns_the_default_with_empty_default():
|
||||
"""The default parameter should be returned when no patterns are given."""
|
||||
sentinel = object()
|
||||
assert utils.fnmatch('file.py', [], default=sentinel) is sentinel
|
||||
|
||||
|
||||
def test_filenames_from_a_directory():
|
||||
"""Verify that filenames_from walks a directory."""
|
||||
filenames = list(utils.filenames_from('flake8/'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue