mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
replace filter with list comprehension
to improve readability the filter is removed by a list comprehension
This commit is contained in:
parent
d76fbb46be
commit
c5238d9311
1 changed files with 5 additions and 6 deletions
|
|
@ -58,10 +58,9 @@ def test_sdist_contents(pytestconfig, expected_file):
|
|||
dir_matcher = ""
|
||||
if expected_file.endswith("/"):
|
||||
dir_matcher = ".*"
|
||||
filtered_values = list(
|
||||
filter(
|
||||
lambda v: match(f"^pelican-\d.\d.\d/{expected_file}{dir_matcher}$", v),
|
||||
files_list,
|
||||
)
|
||||
)
|
||||
filtered_values = [
|
||||
path
|
||||
for path in files_list
|
||||
if match(f"^pelican-\d\.\d\.\d/{expected_file}{dir_matcher}$", path)
|
||||
]
|
||||
assert len(filtered_values) > 0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue