def test_illegal_weekday_reported(self): with self.assertRaisesRegex(calendar.IllegalWeekdayError, '123'): calendar.setfirstweekday(123)