[Python-checkins] bpo-46484:Add test for Calendar.iterweekdays (GH-30825)

iritkatriel webhook-mailer at python.org
Mon Apr 4 13:17:05 EDT 2022


https://github.com/python/cpython/commit/48269ea9fdbc5804f80962364f95e69097c417ba
commit: 48269ea9fdbc5804f80962364f95e69097c417ba
branch: main
author: 180909 <734461790 at qq.com>
committer: iritkatriel <1055913+iritkatriel at users.noreply.github.com>
date: 2022-04-04T18:16:56+01:00
summary:

bpo-46484:Add test for Calendar.iterweekdays (GH-30825)

files:
M Lib/test/test_calendar.py
M Misc/ACKS

diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py
index e6bd4d03e0f63..f76cbc9472a6e 100644
--- a/Lib/test/test_calendar.py
+++ b/Lib/test/test_calendar.py
@@ -619,6 +619,14 @@ def test_itermonthdays2(self):
                 self.assertEqual(days[0][1], firstweekday)
                 self.assertEqual(days[-1][1], (firstweekday - 1) % 7)
 
+    def test_iterweekdays(self):
+        week0 = list(range(7))
+        for firstweekday in range(7):
+            cal = calendar.Calendar(firstweekday)
+            week = list(cal.iterweekdays())
+            expected = week0[firstweekday:] + week0[:firstweekday]
+            self.assertEqual(week, expected)
+
 
 class MonthCalendarTestCase(unittest.TestCase):
     def setUp(self):
diff --git a/Misc/ACKS b/Misc/ACKS
index 72e2cfe13775a..33e1c4c492983 100644
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -1886,6 +1886,7 @@ Jacob Walls
 Kevin Walzer
 Rodrigo Steinmuller Wanderley
 Dingyuan Wang
+Jiahua Wang
 Ke Wang
 Liang-Bo Wang
 Greg Ward



More information about the Python-checkins mailing list