Skip to content

Commit 8b06d01

Browse files
authored
bpo-45292: Use raw strings for regex in tests (GH-29545)
1 parent b931077 commit 8b06d01

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Lib/test/test_exception_group.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,18 @@ def test_bad_EG_construction__bad_message(self):
3838
ExceptionGroup(None, [ValueError(12)])
3939

4040
def test_bad_EG_construction__bad_excs_sequence(self):
41-
MSG = 'second argument \(exceptions\) must be a sequence'
41+
MSG = r'second argument \(exceptions\) must be a sequence'
4242
with self.assertRaisesRegex(TypeError, MSG):
4343
ExceptionGroup('errors not sequence', {ValueError(42)})
4444
with self.assertRaisesRegex(TypeError, MSG):
4545
ExceptionGroup("eg", None)
4646

47-
MSG = 'second argument \(exceptions\) must be a non-empty sequence'
47+
MSG = r'second argument \(exceptions\) must be a non-empty sequence'
4848
with self.assertRaisesRegex(ValueError, MSG):
4949
ExceptionGroup("eg", [])
5050

5151
def test_bad_EG_construction__nested_non_exceptions(self):
52-
MSG = ('Item [0-9]+ of second argument \(exceptions\)'
52+
MSG = (r'Item [0-9]+ of second argument \(exceptions\)'
5353
' is not an exception')
5454
with self.assertRaisesRegex(ValueError, MSG):
5555
ExceptionGroup('expect instance, not type', [OSError]);

0 commit comments

Comments
 (0)