Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf0d0be3

Browse files
hugovkAA-Turnerambv
authored
gh-57539: Increase calendar test coverage (GH-93468)
Co-authored-by: Sean FlemingCo-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>Co-authored-by: Łukasz Langa <lukasz@langa.pl>
1 parent1b74803 commitf0d0be3

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

‎Lib/test/test_calendar.py‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,19 @@ def test_locale_calendars(self):
564564
new_october=calendar.TextCalendar().formatmonthname(2010,10,10)
565565
self.assertEqual(old_october,new_october)
566566

567+
deftest_locale_calendar_formatweekday(self):
568+
try:
569+
# formatweekday uses different day names based on the available width.
570+
cal=calendar.LocaleTextCalendar(locale='en_US')
571+
# For short widths, a centered, abbreviated name is used.
572+
self.assertEqual(cal.formatweekday(0,5)," Mon ")
573+
# For really short widths, even the abbreviated name is truncated.
574+
self.assertEqual(cal.formatweekday(0,2),"Mo")
575+
# For long widths, the full day name is used.
576+
self.assertEqual(cal.formatweekday(0,10)," Monday ")
577+
exceptlocale.Error:
578+
raiseunittest.SkipTest('cannot set the en_US locale')
579+
567580
deftest_locale_html_calendar_custom_css_class_month_name(self):
568581
try:
569582
cal=calendar.LocaleHTMLCalendar(locale='')

‎Misc/ACKS‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -548,6 +548,7 @@ Nils Fischbeck
548548
Frederik Fix
549549
Tom Flanagan
550550
Matt Fleming
551+
Sean Fleming
551552
Hernán Martínez Foffani
552553
Benjamin Fogle
553554
Artem Fokin
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Increase calendar test coverage for:meth:`calendar.LocaleTextCalendar.formatweekday`.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp