FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-104012: Ensure test_calendar.CalendarTestCase.test_deprecation_warning consistently passes by AlexWaygood · Pull Request #104014 · python/cpython · GitHub

/ cpython Public
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .py  (1) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 4 additions & 4 deletions Lib/test/test_calendar.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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

Back | FazBrowse Home | New Git URL