fix: resolve pyright type errors in api.py and test_api.py
lint / lint (push) Successful in 1m57s
test / unit (pull_request) Successful in 45s
test / integration (pull_request) Successful in 21s
test / coverage (pull_request) Failing after 57s

Cast Die.code (_ExitCode) to int before passing to BottleError — Die
always holds an int but SystemExit.code is typed as str|int|None in
typeshed. Replace untyped lambda with str() as identity for
_uniquify_label_headless mock (fixes reportUnknownLambdaType).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-07-01 20:26:37 +00:00
parent 520e6f545d
commit e6cafa39e0
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -56,7 +56,7 @@ class TestStartHeadless(unittest.TestCase):
"bot_bottle.api._launch_bottle", return_value=("implementer-abc12", 0)
).start()
patch(
"bot_bottle.api._uniquify_label_headless", side_effect=lambda lbl: lbl
"bot_bottle.api._uniquify_label_headless", side_effect=str
).start()
self.addCleanup(patch.stopall)