🐛 Ensure that the default rich_markup_mode is interpreted correctly#1304
🐛 Ensure that the default rich_markup_mode is interpreted correctly#1304tiangolo merged 11 commits intofastapi:masterfrom
rich_markup_mode is interpreted correctly#1304Conversation
|
The failing coverage test reveals that there are code paths in In fact, the formatting methods in |
|
Feels to me like the CI is failing due to an unrelated issue - I'll investigate. [UPDATE]: fixed with #1333 |
| def test_markup_mode_default(): | ||
| # We're assuming the test suite is run with rich installed | ||
| app = typer.Typer() | ||
| assert app.rich_markup_mode == "rich" |
There was a problem hiding this comment.
on master, this fails with
<typer.models.DefaultPlaceholder object at 0x00000227BB50B130> != rich
By using
Default(DEFAULT_MARKUP_MODE),rich_markup_modewould be atyper.models.DefaultPlaceholderobject and comparing it to other literal strings likeMARKUP_MODE_RICHwould fail. This resulted in flaky behaviour such as reported in #976, where Rich formatting worked fine when specifying it correctly, but the default value (with Rich installed) didn't result in the same behaviour.This PR fixes that by simply not using
Defaultfor this value - there's no real reason to use it anyway, as it's unimportant to the application whether it's a default or a user-set value.