Skip to content

Commit ca4ab58

Browse files
committed
Add test for colour
1 parent 6719b32 commit ca4ab58

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

Lib/test/test_calendar.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,15 @@ def test_html_output_year_css(self):
12561256
self.assertIn(b'<link rel="stylesheet" href="custom.css">', output)
12571257

12581258

1259+
@support.force_colorized_test_class
1260+
class ColorTestCase(unittest.TestCase):
1261+
def test_formatmonth_color(self):
1262+
today = datetime.date(2026, 5, 4)
1263+
cal = calendar._CLIDemoCalendar(highlight_day=today)
1264+
output = cal.formatmonth(2026, 5)
1265+
self.assertIn("\x1b[30m\x1b[43mMay 2026\x1b[0m\n\x1b[36m", output)
1266+
1267+
12591268
class MiscTestCase(unittest.TestCase):
12601269
def test__all__(self):
12611270
not_exported = {

0 commit comments

Comments
 (0)