Enable the PLC0206 lint in Ruff

This commit is contained in:
Adam Turner
2024-10-19 01:16:07 +01:00
parent c78b4c5404
commit 9e1c27aca0
2 changed files with 2 additions and 3 deletions

View File

@@ -36,7 +36,6 @@ ignore = [
# flake8-pie ('PIE')
"PIE790", # Unnecessary `pass` statement
# pylint ('PLC')
"PLC0206", # Extracting value from dictionary without calling `.items()`
"PLC0415", # `import` should be at the top-level of a file
"PLC1901", # simplify truthy/falsey string comparisons
"PLC2701", # Private name import `{name}` from external module `{module}`

View File

@@ -31,9 +31,9 @@ def mock_input(
'answer for %r missing and no default present' % prompt
)
called.add(prompt)
for question in answers:
for question, answer in answers.items():
if prompt.startswith(qs.PROMPT_PREFIX + question):
return answers[question]
return answer
if needanswer:
raise AssertionError('answer for %r missing' % prompt)
return ''