Fix DeprecationWarning: invalid escape sequence

This commit is contained in:
Hugo 2018-10-02 10:57:07 +03:00
parent a3b0659790
commit bab194b6f5

View File

@ -453,7 +453,7 @@ class CoreResampleBoxTest(PillowTestCase):
# error with box should be much smaller than without
self.assert_image_similar(reference, with_box, 6)
with self.assertRaisesRegex(AssertionError, "difference 29\."):
with self.assertRaisesRegex(AssertionError, r"difference 29\."):
self.assert_image_similar(reference, without_box, 5)
def test_formats(self):
@ -496,7 +496,7 @@ class CoreResampleBoxTest(PillowTestCase):
try:
res = im.resize(size, Image.LANCZOS, box)
self.assertEqual(res.size, size)
with self.assertRaisesRegex(AssertionError, "difference \d"):
with self.assertRaisesRegex(AssertionError, r"difference \d"):
# check that the difference at least that much
self.assert_image_similar(res, im.crop(box), 20)
except AssertionError: