From 6a7e299c096bf128155d42b7554000f4343ef8fd Mon Sep 17 00:00:00 2001 From: Sascha Brawer Date: Tue, 22 Jan 2019 16:36:15 +0100 Subject: [PATCH] =?UTF-8?q?Fix=20=E2=80=9CDeprecationWarning:=20invalid=20?= =?UTF-8?q?escape=20sequence=E2=80=9D=20in=20Python=203.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Tests/misc/loggingTools_test.py | 4 ++-- Tests/ttLib/woff2_test.py | 6 +++--- Tests/voltLib/parser_test.py | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Tests/misc/loggingTools_test.py b/Tests/misc/loggingTools_test.py index 694c10909..b402efa5a 100644 --- a/Tests/misc/loggingTools_test.py +++ b/Tests/misc/loggingTools_test.py @@ -122,13 +122,13 @@ class TimerTest(object): test1() assert re.match( - "Took [0-9]\.[0-9]{3}s to run 'test1'", + r"Took [0-9]\.[0-9]{3}s to run 'test1'", logger.handlers[0].stream.getvalue()) test2() assert re.search( - "Took [0-9]\.[0-9]{3}s to run test 2", + r"Took [0-9]\.[0-9]{3}s to run test 2", logger.handlers[0].stream.getvalue()) diff --git a/Tests/ttLib/woff2_test.py b/Tests/ttLib/woff2_test.py index b3ec6b21a..55c4b778e 100644 --- a/Tests/ttLib/woff2_test.py +++ b/Tests/ttLib/woff2_test.py @@ -765,7 +765,7 @@ class Base128Test(unittest.TestCase): self.assertRaisesRegex( ttLib.TTLibError, - "UIntBase128 value exceeds 2\*\*32-1", + r"UIntBase128 value exceeds 2\*\*32-1", unpackBase128, b'\x90\x80\x80\x80\x00') self.assertRaisesRegex( @@ -783,11 +783,11 @@ class Base128Test(unittest.TestCase): self.assertEqual(packBase128(2**32-1), b'\x8f\xff\xff\xff\x7f') self.assertRaisesRegex( ttLib.TTLibError, - "UIntBase128 format requires 0 <= integer <= 2\*\*32-1", + r"UIntBase128 format requires 0 <= integer <= 2\*\*32-1", packBase128, 2**32+1) self.assertRaisesRegex( ttLib.TTLibError, - "UIntBase128 format requires 0 <= integer <= 2\*\*32-1", + r"UIntBase128 format requires 0 <= integer <= 2\*\*32-1", packBase128, -1) diff --git a/Tests/voltLib/parser_test.py b/Tests/voltLib/parser_test.py index 7440a67bd..7ad468605 100644 --- a/Tests/voltLib/parser_test.py +++ b/Tests/voltLib/parser_test.py @@ -450,10 +450,10 @@ class ParserTest(unittest.TestCase): def test_lookup_name_starts_with_letter(self): with self.assertRaisesRegex( VoltLibError, - 'Lookup name "\\\lookupname" must start with a letter' + r'Lookup name "\\lookupname" must start with a letter' ): [lookup] = self.parse( - 'DEF_LOOKUP "\lookupname"\n' + 'DEF_LOOKUP "\\lookupname"\n' 'AS_SUBSTITUTION\n' 'SUB GLYPH "a"\n' 'WITH GLYPH "a.alt"\n'