Commit c66178a0 by Mathieu Kniewallner Committed by Randy Döring

refactor: remove unnecessary maps to respect `C417`

parent 837dd3fa
...@@ -26,7 +26,7 @@ class SourceShowCommand(Command): ...@@ -26,7 +26,7 @@ class SourceShowCommand(Command):
self.line("No sources configured for this project.") self.line("No sources configured for this project.")
return 0 return 0
if names and not any(map(lambda s: s.name in names, sources)): if names and not any(s.name in names for s in sources):
self.line_error(f"No source found with name(s): {', '.join(names)}") self.line_error(f"No source found with name(s): {', '.join(names)}")
return 1 return 1
......
...@@ -384,7 +384,7 @@ class Authenticator: ...@@ -384,7 +384,7 @@ class Authenticator:
logger.debug( logger.debug(
"Multiple source configurations found for %s - %s", "Multiple source configurations found for %s - %s",
parsed_url.netloc, parsed_url.netloc,
", ".join(map(lambda c: c.name, candidates)), ", ".join(c.name for c in candidates),
) )
# prefer the more specific path # prefer the more specific path
candidates.sort( candidates.sort(
......
...@@ -41,10 +41,9 @@ url : https://two.com ...@@ -41,10 +41,9 @@ url : https://two.com
default : no default : no
secondary : no secondary : no
""".splitlines() """.splitlines()
assert ( assert [
list(map(lambda l: l.strip(), tester.io.fetch_output().strip().splitlines())) line.strip() for line in tester.io.fetch_output().strip().splitlines()
== expected ] == expected
)
assert tester.status_code == 0 assert tester.status_code == 0
...@@ -57,10 +56,9 @@ url : https://one.com ...@@ -57,10 +56,9 @@ url : https://one.com
default : no default : no
secondary : no secondary : no
""".splitlines() """.splitlines()
assert ( assert [
list(map(lambda l: l.strip(), tester.io.fetch_output().strip().splitlines())) line.strip() for line in tester.io.fetch_output().strip().splitlines()
== expected ] == expected
)
assert tester.status_code == 0 assert tester.status_code == 0
...@@ -78,10 +76,9 @@ url : https://two.com ...@@ -78,10 +76,9 @@ url : https://two.com
default : no default : no
secondary : no secondary : no
""".splitlines() """.splitlines()
assert ( assert [
list(map(lambda l: l.strip(), tester.io.fetch_output().strip().splitlines())) line.strip() for line in tester.io.fetch_output().strip().splitlines()
== expected ] == expected
)
assert tester.status_code == 0 assert tester.status_code == 0
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment