Silence a py3k warning claiming to affect Lib/calendar.py
This commit is contained in:
parent
63b0cb2f39
commit
e22997ec7c
|
@ -212,9 +212,11 @@ class CalendarTestCase(unittest.TestCase):
|
||||||
self.assertEqual(calendar.isleap(2003), 0)
|
self.assertEqual(calendar.isleap(2003), 0)
|
||||||
|
|
||||||
def test_setfirstweekday(self):
|
def test_setfirstweekday(self):
|
||||||
self.assertRaises(ValueError, calendar.setfirstweekday, 'flabber')
|
# Silence a py3k warning claiming to affect Lib/calendar.py
|
||||||
self.assertRaises(ValueError, calendar.setfirstweekday, -1)
|
with test_support.check_warnings():
|
||||||
self.assertRaises(ValueError, calendar.setfirstweekday, 200)
|
self.assertRaises(ValueError, calendar.setfirstweekday, 'flabber')
|
||||||
|
self.assertRaises(ValueError, calendar.setfirstweekday, -1)
|
||||||
|
self.assertRaises(ValueError, calendar.setfirstweekday, 200)
|
||||||
orig = calendar.firstweekday()
|
orig = calendar.firstweekday()
|
||||||
calendar.setfirstweekday(calendar.SUNDAY)
|
calendar.setfirstweekday(calendar.SUNDAY)
|
||||||
self.assertEqual(calendar.firstweekday(), calendar.SUNDAY)
|
self.assertEqual(calendar.firstweekday(), calendar.SUNDAY)
|
||||||
|
|
Loading…
Reference in New Issue