gh-148352: Add more colour to calendar CLI output - #148354
Conversation
Co-authored-by: Rihaan Meher <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
Co-authored-by: Rihaan Meher <[email protected]>
| @@ -1122,4 +1123,4 @@ | |||
| self.assertCmdFails(*args) | |||
|
|
|||
| @support.force_not_colorized | |||
| self.assertCmdFails(*args) | ||
|
|
||
| @support.force_not_colorized | ||
| def test_help(self): |
There was a problem hiding this comment.
Can we also have a case checking for color?
Documentation build overview
52 files changed ·
|
| today = datetime.date(2026, 5, 4) | ||
| cal = calendar._CLIDemoCalendar(highlight_day=today) | ||
| output = cal.formatmonth(2026, 5) | ||
| self.assertIn("\x1b[30m\x1b[43mMay 2026\x1b[0m\n\x1b[36m", output) |
There was a problem hiding this comment.
Hmm, do we support running tests with different themes? If a user has a custom theme this test will fail.
There was a problem hiding this comment.
We don't support running tests with different themes.
Other tests could also break if the user changed the theme:
❯ rg "x1b" Lib/test/test_*.py -l | wc -l
13Right now the theme API is internal/private. If we make it public in a later release, we'll need to consider tests are with the default theme or a specific theme.
|
Thanks @sharktide and @StanFromIreland for the reviews! |
In Python 3.14, we added an amazing colour highlight for today: #128318.
Let's add a touch more colour.
calendarCLI output #148352📚 Documentation preview 📚: https://cpython-previews--148354.org.readthedocs.build/