Skip to content

Commit 0c0d537

Browse files
Issue python#26198: Make datetime error tests more lenient.
1 parent c4b813d commit 0c0d537

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/test/datetimetester.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ def test_format(self):
12391239
dt = self.theclass(2007, 9, 10)
12401240
self.assertEqual(dt.__format__(''), str(dt))
12411241

1242-
with self.assertRaisesRegex(TypeError, '^must be str, not int$'):
1242+
with self.assertRaisesRegex(TypeError, 'must be str, not int'):
12431243
dt.__format__(123)
12441244

12451245
# check that a derived class's __str__() gets called
@@ -1574,7 +1574,7 @@ def test_format(self):
15741574
dt = self.theclass(2007, 9, 10, 4, 5, 1, 123)
15751575
self.assertEqual(dt.__format__(''), str(dt))
15761576

1577-
with self.assertRaisesRegex(TypeError, '^must be str, not int$'):
1577+
with self.assertRaisesRegex(TypeError, 'must be str, not int'):
15781578
dt.__format__(123)
15791579

15801580
# check that a derived class's __str__() gets called
@@ -2336,7 +2336,7 @@ def test_format(self):
23362336
t = self.theclass(1, 2, 3, 4)
23372337
self.assertEqual(t.__format__(''), str(t))
23382338

2339-
with self.assertRaisesRegex(TypeError, '^must be str, not int$'):
2339+
with self.assertRaisesRegex(TypeError, 'must be str, not int'):
23402340
t.__format__(123)
23412341

23422342
# check that a derived class's __str__() gets called

0 commit comments

Comments
 (0)