MCPcopy Index your code
hub / github.com/python/cpython / test_itermonthdays

Method test_itermonthdays

Lib/test/test_calendar.py:843–853  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

841 self.assertEqual(days[-1], (2001, 2, 28, 2))
842
843 def test_itermonthdays(self):
844 for firstweekday in range(7):
845 cal = calendar.Calendar(firstweekday)
846 # Test the extremes, see #28253 and #26650
847 for y, m in [(1, 1), (9999, 12)]:
848 days = list(cal.itermonthdays(y, m))
849 self.assertIn(len(days), (35, 42))
850 # Test a short month
851 cal = calendar.Calendar(firstweekday=3)
852 days = list(cal.itermonthdays(2001, 2))
853 self.assertEqual(days, list(range(1, 29)))
854
855 def test_itermonthdays2(self):
856 for firstweekday in range(7):

Callers

nothing calls this directly

Calls 4

itermonthdaysMethod · 0.95
listClass · 0.85
assertInMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected