The empty-string check in help rendering must not break on objects whose ``__eq__`` raises for string operands. Regression test for https://github.com/pallets/click/issues/3298.
(runner, default, expected)
| 1307 | ids=["empty-string", "non-string-comparable-object"], |
| 1308 | ) |
| 1309 | def test_show_default_with_empty_string(runner, default, expected): |
| 1310 | """The empty-string check in help rendering must not break on objects |
| 1311 | whose ``__eq__`` raises for string operands. |
| 1312 | |
| 1313 | Regression test for https://github.com/pallets/click/issues/3298. |
| 1314 | """ |
| 1315 | opt = click.Option(["--limit"], default=default, show_default=True) |
| 1316 | ctx = click.Context(click.Command("cli")) |
| 1317 | message = opt.get_help_record(ctx)[1] |
| 1318 | assert expected in message |
| 1319 | |
| 1320 | |
| 1321 | def test_do_not_show_no_default(runner): |
nothing calls this directly
no test coverage detected