Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Lib/test/test_calendar.py
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,11 @@ def test_format(self):
class CalendarTestCase(unittest.TestCase):

def test_deprecation_warning(self):
with warnings.catch_warnings(record=True) as w:
with self.assertWarnsRegex(
DeprecationWarning,
"The 'January' attribute is deprecated, use 'JANUARY' instead"
):
calendar.January
self.assertEqual(len(w), 1)
self.assertEqual(w[0].category, DeprecationWarning)
self.assertIn("The 'January' attribute is deprecated, use 'JANUARY' instead", str(w[0].message))

def test_isleap(self):
# Make sure that the return is right for a few years, and
Expand Down