summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2016-02-08 07:26:57 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2016-02-08 07:26:57 (GMT)
commitd0c1f7743d7abe802e2013f26c14590c107e8350 (patch)
tree10a3957d00df267d596935f500d88dbd34f9ca78
parent4cd63ef67a3e0974f0c48c550769babd401075e3 (diff)
parent0c0d537b24f66cf16c76ce8f13c21de2ebdbdf44 (diff)
downloadcpython-d0c1f7743d7abe802e2013f26c14590c107e8350.zip
cpython-d0c1f7743d7abe802e2013f26c14590c107e8350.tar.gz
cpython-d0c1f7743d7abe802e2013f26c14590c107e8350.tar.bz2
Issue #26198: Make datetime error tests more lenient.
-rw-r--r--Lib/test/datetimetester.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/datetimetester.py b/Lib/test/datetimetester.py
index 7374608..68c18bd 100644
--- a/Lib/test/datetimetester.py
+++ b/Lib/test/datetimetester.py
@@ -1240,7 +1240,7 @@ class TestDate(HarmlessMixedComparison, unittest.TestCase):
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 @@ class TestDateTime(TestDate):
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 @@ class TestTime(HarmlessMixedComparison, unittest.TestCase):
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