diff --git a/tests/test_cli_predict.py b/tests/test_cli_predict.py index b826fc2..7459e1c 100644 --- a/tests/test_cli_predict.py +++ b/tests/test_cli_predict.py @@ -233,6 +233,13 @@ def test_predict_truth_metadata_key_exists(): def test_predict_has_truth_flag_default_on(): - result = runner.invoke(app, ["predict", "--help"]) - assert "--truth" in result.output - assert "--no-truth" in result.output + # Inspecting rendered --help text is brittle across terminal + # widths/color settings (wraps or re-colors mid-flag); go straight to + # the underlying click command's registered option instead. + import typer + + predict_cmd = typer.main.get_command(app).commands["predict"] + truth_param = next(p for p in predict_cmd.params if p.name == "truth") + assert truth_param.opts == ["--truth"] + assert truth_param.secondary_opts == ["--no-truth"] + assert truth_param.default is True