我们从Python开源项目中,提取了以下19个代码示例,用于说明如何使用calendar.IllegalMonthError()。
def test_zeroth_month(self): # Tests low invalid boundary case. with self.assertRaises(calendar.IllegalMonthError): calendar.monthrange(2004, 0)
def test_thirteenth_month(self): # Tests high invalid boundary case. with self.assertRaises(calendar.IllegalMonthError): calendar.monthrange(2004, 13)
def test_illegal_month_reported(self): with self.assertRaisesRegex(calendar.IllegalMonthError, '65'): calendar.monthrange(2004, 65)