mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-70647: Deprecate strptime day of month parsing without a year present to avoid leap-year bugs (GH-117107)
This commit is contained in:
parent
595bb496b0
commit
33ee5cb3e9
7 changed files with 117 additions and 1 deletions
|
@ -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'),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue