]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Test `calendar.February` deprecation (#153893)
authorvjabuilds <77214151+vjabuilds@users.noreply.github.com>
Sat, 18 Jul 2026 10:54:10 +0000 (12:54 +0200)
committerGitHub <noreply@github.com>
Sat, 18 Jul 2026 10:54:10 +0000 (12:54 +0200)
Calendar related tests now check if both deprecated constants surface the proper warnings.

* extended `test_deprecation_warning` to check `constants.February` as well

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Lib/test/test_calendar.py

index 6ed27b4095bc1dbb25db2baf9ce60884b7d1f466..8646cfcad58cea89cde4500a53514e81b776bcfe 100644 (file)
@@ -554,6 +554,11 @@ class CalendarTestCase(unittest.TestCase):
             "The 'January' attribute is deprecated, use 'JANUARY' instead"
         ):
             calendar.January
+        with self.assertWarnsRegex(
+            DeprecationWarning,
+            "The 'February' attribute is deprecated, use 'FEBRUARY' instead"
+        ):
+            calendar.February
 
     def test_isleap(self):
         # Make sure that the return is right for a few years, and