[Python-checkins] cpython (merge 3.5 -> default): Issue #26198: Make datetime error tests more lenient.

serhiy.storchaka python-checkins at python.org
Mon Feb 8 02:27:47 EST 2016


https://hg.python.org/cpython/rev/a9c9e4054f3f
changeset:   100182:a9c9e4054f3f
parent:      100180:53d66a554beb
parent:      100181:22b0a63808f8
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Feb 08 09:26:57 2016 +0200
summary:
  Issue #26198: Make datetime error tests more lenient.

files:
  Lib/test/datetimetester.py |  6 +++---
  1 files changed, 3 insertions(+), 3 deletions(-)


diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1240,7 +1240,7 @@
         dt = self.theclass(2007, 9, 10)
         self.assertEqual(dt.__format__(''), str(dt))
 
-        with self.assertRaisesRegex(TypeError, '^must be str, not int$'):
+        with self.assertRaisesRegex(TypeError, 'must be str, not int'):
             dt.__format__(123)
 
         # check that a derived class's __str__() gets called
@@ -1575,7 +1575,7 @@
         dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
         self.assertEqual(dt.__format__(''), str(dt))
 
-        with self.assertRaisesRegex(TypeError, '^must be str, not int$'):
+        with self.assertRaisesRegex(TypeError, 'must be str, not int'):
             dt.__format__(123)
 
         # check that a derived class's __str__() gets called
@@ -2337,7 +2337,7 @@
         t = self.theclass(1, 2, 3, 4)
         self.assertEqual(t.__format__(''), str(t))
 
-        with self.assertRaisesRegex(TypeError, '^must be str, not int$'):
+        with self.assertRaisesRegex(TypeError, 'must be str, not int'):
             t.__format__(123)
 
         # check that a derived class's __str__() gets called

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list