8000
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 53859e4 commit a24e9b4Copy full SHA for a24e9b4
Lib/test/test_calendar.py
@@ -493,12 +493,11 @@ def test_format(self):
493
class CalendarTestCase(unittest.TestCase):
494
495
def test_deprecation_warning(self):
496
- warnings.resetwarnings()
497
- with warnings.catch_warnings(record=True) as w:
+ with self.assertWarnsRegex(
+ 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)
501
- self.assertIn("The 'January' attribute is deprecated, use 'JANUARY' instead", str(w[0].message))
502
503
def test_isleap(self):
504
# Make sure that the return is right for a few years, and
0 commit comments