We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f186557 commit 7d3931eCopy full SHA for 7d3931e
Lib/test/test_calendar.py
@@ -493,11 +493,11 @@ def test_format(self):
493
class CalendarTestCase(unittest.TestCase):
494
495
def test_deprecation_warning(self):
496
- with warnings.catch_warnings(record=True) as w:
+ with self.assertWarnsRegex(
497
+ DeprecationWarning,
498
+ "The 'January' attribute is deprecated, use 'JANUARY' instead"
499
+ ):
500
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))
501
502
def test_isleap(self):
503
# Make sure that the return is right for a few years, and
0 commit comments