Repository navigation
test(cli): fix the healthcheck tests for Typer 0.29 - #571
Conversation
Typer 0.29 ships its own CliRunner, which takes only charset and env, so CliRunner(mix_stderr=False) in test_healthcheck.py raised TypeError at collection once #535 lifted the Typer hold, and main's CI broke. The healthcheck command prints only to stdout and the tests check exit codes, so a plain CliRunner() is enough. That collection error also hid test_help.py::test_commands_cover_cli, which fails because COMMANDS lacked healthcheck (#524); it is added.
WilhelmZA
left a comment
There was a problem hiding this comment.
Reviewed at 14e6ecef.
The change is correct. CliRunner() drops the mix_stderr argument that the runner no longer accepts, and healthcheck is added to COMMANDS so test_commands_cover_cli matches the registered commands. No mix_stderr is left in the tree. The branch contains current main (b9517a39), CI gate passes on it, both backend jobs included, and the commit is verified.
Before approval:
- The body has no
Closes #norPart of #n. Please open an issue for the red CI onmainsince #535 and link it withCloses. No new commit is needed; I will approve this head once the link is in the body.
|
Opened #572 for the red CI on |
WilhelmZA
left a comment
There was a problem hiding this comment.
Approving at 14e6ecef.
The body now closes #572. The change is as reviewed: CliRunner() without mix_stderr, and healthcheck added to COMMANDS. The branch contains current main (b9517a39), CI gate passes on it with both backend jobs, and the commit is verified.
The other open PRs need a rebase onto main after this merges, because their CI gate fails on the same collection error.
Problem
mainCI has been red since #535 merged (run 44912884609):#524 added
test_healthcheck.pywithCliRunner(mix_stderr=False). #535 lifted the Typer hold to 0.29.2. That version ships its owntyper.testing.CliRunner, whose signature is(charset, env), so the argument raises at import. Both PRs were green on their own, and the break only appears once both are onmain.The collection error also hid a second failure:
test_help.py::test_commands_cover_clirequires every registered command to be inCOMMANDS, and #524'shealthcheckwasn't.Change
test_healthcheck.py:CliRunner().healthcheckprints only to stdout throughecho.success/echo.error, and the tests assert exit codes, somix_stderr=Falsenever affected them. Nomix_stderrremains in the repo.test_help.py: add("healthcheck",)toCOMMANDS.Tests
Notes
main.test_unhealthyandtest_unreachableonly assertexit_code == 1, so they can't tell their branches apart. Asserting short substrings ofresult.stdoutwould make them stronger.Closes #572