diff options
author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2021-11-16 11:58:21 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-16 17:28:21 +0530 |
commit | 8b06d01507fd708468570eaa43a349828784489a (patch) | |
tree | 1430174d8fc6f73a5107480a8565cb3fde34a2b2 /Lib/test/test_exception_group.py | |
parent | b9310773756f40f77e075f221a90dd41e6964efc (diff) | |
download | cpython-8b06d01507fd708468570eaa43a349828784489a.tar.gz cpython-8b06d01507fd708468570eaa43a349828784489a.zip |
bpo-45292: Use raw strings for regex in tests (GH-29545)
Diffstat (limited to 'Lib/test/test_exception_group.py')
-rw-r--r-- | Lib/test/test_exception_group.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_exception_group.py b/Lib/test/test_exception_group.py index 5bb6094cde7..62ec1ee248d 100644 --- a/Lib/test/test_exception_group.py +++ b/Lib/test/test_exception_group.py @@ -38,18 +38,18 @@ class BadConstructorArgs(unittest.TestCase): ExceptionGroup(None, [ValueError(12)]) def test_bad_EG_construction__bad_excs_sequence(self): - MSG = 'second argument \(exceptions\) must be a sequence' + MSG = r'second argument \(exceptions\) must be a sequence' with self.assertRaisesRegex(TypeError, MSG): ExceptionGroup('errors not sequence', {ValueError(42)}) with self.assertRaisesRegex(TypeError, MSG): ExceptionGroup("eg", None) - MSG = 'second argument \(exceptions\) must be a non-empty sequence' + MSG = r'second argument \(exceptions\) must be a non-empty sequence' with self.assertRaisesRegex(ValueError, MSG): ExceptionGroup("eg", []) def test_bad_EG_construction__nested_non_exceptions(self): - MSG = ('Item [0-9]+ of second argument \(exceptions\)' + MSG = (r'Item [0-9]+ of second argument \(exceptions\)' ' is not an exception') with self.assertRaisesRegex(ValueError, MSG): ExceptionGroup('expect instance, not type', [OSError]); |