changeset: 98923:fb9d4ccbadf0 parent: 98922:f7db966c9fee parent: 98860:960aa7c1819a user: Rohit Mediratta date: Sun Nov 01 01:02:39 2015 -0700 summary: Increased test coverage of calendar module diff -r f7db966c9fee -r fb9d4ccbadf0 Lib/test/test_calendar.py --- a/Lib/test/test_calendar.py Sun Nov 01 00:55:31 2015 +0300 +++ b/Lib/test/test_calendar.py Sun Nov 01 01:02:39 2015 -0700 @@ -479,17 +479,20 @@ # (it is still not thread-safe though) old_october = calendar.TextCalendar().formatmonthname(2010, 10, 10) try: - cal = calendar.LocaleTextCalendar(locale='') + cal = calendar.LocaleTextCalendar(locale=None) local_weekday = cal.formatweekday(1, 10) + local_weekday_abbr = cal.formatweekday(1, 3) local_month = cal.formatmonthname(2010, 10, 10) except locale.Error: # cannot set the system default locale -- skip rest of test raise unittest.SkipTest('cannot set the system default locale') self.assertIsInstance(local_weekday, str) + self.assertIsInstance(local_weekday_abbr, str) self.assertIsInstance(local_month, str) self.assertEqual(len(local_weekday), 10) + self.assertEqual(len(local_weekday_abbr), 3) self.assertGreaterEqual(len(local_month), 10) - cal = calendar.LocaleHTMLCalendar(locale='') + cal = calendar.LocaleHTMLCalendar(locale=None) local_weekday = cal.formatweekday(1) local_month = cal.formatmonthname(2010, 10) self.assertIsInstance(local_weekday, str)