tests: use raw strings in test-cbor.py
authorGregory Szorc <gregory.szorc@gmail.com>
Mon, 04 Feb 2019 14:05:26 -0800
changeset 41563 1ea1bba1c5be
parent 41562 6dae1f31c6c9
child 41564 7295279b9ea5
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
tests/test-cbor.py
--- 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):