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
gh-101377: improving test_locale_calendar_formatweekday of calendar (G…
…H-101378)

---------

(cherry picked from commit 5e0865f)

Co-authored-by: Andre Hora <andrehora@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
  • Loading branch information
3 people authored and miss-islington committed Mar 15, 2023
commit c019bb6384cbf171c6e2ebb1f9962d5b2ac78672
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