Skip to content

Commit

Permalink
gh-104012: Ensure test_calendar.CalendarTestCase.test_deprecation_war…
Browse files Browse the repository at this point in the history
…ning consistently passes (#104014)
  • Loading branch information
AlexWaygood authored Apr 30, 2023
1 parent f186557 commit 7d3931e
Showing 1 changed file with 4 additions and 4 deletions.
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

0 comments on commit 7d3931e

Please sign in to comment.