From: Antoine Pitrou Date: Wed, 14 Oct 2009 18:09:45 +0000 (+0000) Subject: Silence a py3k warning claiming to affect Lib/calendar.py X-Git-Tag: v2.7a1~357 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e22997ec7c507423f597474c75d2459e5b30b063;p=python Silence a py3k warning claiming to affect Lib/calendar.py --- diff --git a/Lib/test/test_calendar.py b/Lib/test/test_calendar.py index fad517c3f5..39d4fe8725 100644 --- a/Lib/test/test_calendar.py +++ b/Lib/test/test_calendar.py @@ -212,9 +212,11 @@ class CalendarTestCase(unittest.TestCase): self.assertEqual(calendar.isleap(2003), 0) def test_setfirstweekday(self): - self.assertRaises(ValueError, calendar.setfirstweekday, 'flabber') - self.assertRaises(ValueError, calendar.setfirstweekday, -1) - self.assertRaises(ValueError, calendar.setfirstweekday, 200) + # Silence a py3k warning claiming to affect Lib/calendar.py + with test_support.check_warnings(): + self.assertRaises(ValueError, calendar.setfirstweekday, 'flabber') + self.assertRaises(ValueError, calendar.setfirstweekday, -1) + self.assertRaises(ValueError, calendar.setfirstweekday, 200) orig = calendar.firstweekday() calendar.setfirstweekday(calendar.SUNDAY) self.assertEqual(calendar.firstweekday(), calendar.SUNDAY)