8000 [3.11] gh-101377: improving test_locale_calendar_formatweekday of calendar (GH-101378) by miss-islington · Pull Request #102713 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.11] gh-101377: improving test_locale_calendar_formatweekday of calendar (GH-101378) #102713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions Lib/test/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -568,11 +568,15 @@ def test_locale_calendar_formatweekday(self):
try:
# formatweekday uses different day names based on the available width.
cal = calendar.LocaleTextCalendar(locale='en_US')
# For really short widths, the abbreviated name is truncated.
self.assertEqual(cal.formatweekday(0, 1), "M")
self.assertEqual(cal.formatweekday(0, 2), "Mo")
# For short widths, a centered, abbreviated name is used.
self.assertEqual(cal.formatweekday(0, 3), "Mon")
self.assertEqual(cal.formatweekday(0, 5), " Mon ")
# For really short widths, even the abbreviated name is truncated.
self.assertEqual(cal.formatweekday(0, 2), "Mo")
self.assertEqual(cal.formatweekday(0, 8), " Mon ")
# For long widths, the full day name is used.
self.assertEqual(cal.formatweekday(0, 9), " Monday ")
self.assertEqual(cal.formatweekday(0, 10), " Monday ")
except locale.Error:
raise unittest.SkipTest('cannot set the en_US locale')
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Improved test_locale_calendar_formatweekday of calendar.
0