changeset 41563:1ea1bba1c5be

tests: use raw strings in test-cbor.py To avoid SyntaxWarning on Python 3.8 due to invalid \ escape. Differential Revision: https://phab.mercurial-scm.org/D5839
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 04 Feb 2019 14:05:26 -0800
parents 6dae1f31c6c9
children 7295279b9ea5
files tests/test-cbor.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/tests/test-cbor.py	Mon Feb 04 14:03:15 2019 -0800
+++ b/tests/test-cbor.py	Mon Feb 04 14:05:26 2019 -0800
@@ -926,7 +926,7 @@
                                  (False, None, -1, cborutil.SPECIAL_NONE))
 
             with self.assertRaisesRegex(cborutil.CBORDecodeError,
-                                        'semantic tag \d+ not allowed'):
+                                        r'semantic tag \d+ not allowed'):
                 cborutil.decodeitem(encoded)
 
 class SpecialTypesTests(TestCase):
@@ -942,7 +942,7 @@
             encoded = cborutil.encodelength(cborutil.MAJOR_TYPE_SPECIAL, i)
 
             with self.assertRaisesRegex(cborutil.CBORDecodeError,
-                                        'special type \d+ not allowed'):
+                                        r'special type \d+ not allowed'):
                 cborutil.decodeitem(encoded)
 
 class SansIODecoderTests(TestCase):