[Python-checkins] cpython (3.5): 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/22b0a63808f8
changeset:   100181:22b0a63808f8
branch:      3.5
parent:      100178:9f998e24d8d8
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Feb 08 09:25:53 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
@@ -1239,7 +1239,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
@@ -1574,7 +1574,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
@@ -2336,7 +2336,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