mirror of
https://github.com/python/cpython.git
synced 2025-11-02 03:01:58 +00:00
gh-104012: Ensure test_calendar.CalendarTestCase.test_deprecation_warning consistently passes (#104014)
This commit is contained in:
parent
f186557dc3
commit
7d3931e94a
1 changed files with 4 additions and 4 deletions
|
|
@ -493,11 +493,11 @@ class OutputTestCase(unittest.TestCase):
|
|||
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue