GH-70647: Deprecate strptime day of month parsing without a year present to avoid leap-year bugs (GH-117107)

This commit is contained in:
Gregory P. Smith 2024-04-03 05:19:49 -07:00 committed by GitHub
parent 595bb496b0
commit 33ee5cb3e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 117 additions and 1 deletions

View file

@ -386,6 +386,16 @@ class TestLongMessage(unittest.TestCase):
'^UserWarning not triggered$',
'^UserWarning not triggered : oops$'])
def test_assertNotWarns(self):
def warn_future():
warnings.warn('xyz', FutureWarning, stacklevel=2)
self.assertMessagesCM('_assertNotWarns', (FutureWarning,),
warn_future,
['^FutureWarning triggered$',
'^oops$',
'^FutureWarning triggered$',
'^FutureWarning triggered : oops$'])
def testAssertWarnsRegex(self):
# test error not raised
self.assertMessagesCM('assertWarnsRegex', (UserWarning, 'unused regex'),