From 4b1784c9ade5a87981a5e22ff229ba33f26a06d1 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Mon, 29 May 2017 19:24:00 +1000 Subject: [PATCH 1/2] Changed file opening to use with --- Tests/test_file_cur.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Tests/test_file_cur.py b/Tests/test_file_cur.py index 5ae0e7eff..e6d13ef30 100644 --- a/Tests/test_file_cur.py +++ b/Tests/test_file_cur.py @@ -26,8 +26,8 @@ class TestFileCur(PillowTestCase): no_cursors_file = "Tests/images/no_cursors.cur" cur = CurImagePlugin.CurImageFile(TEST_FILE) - cur.fp = open(no_cursors_file, "rb") - self.assertRaises(TypeError, cur._open) + with open(no_cursors_file, "rb") as cur.fp: + self.assertRaises(TypeError, cur._open) if __name__ == '__main__': From 2a5447691af2acf905e6d56a3ebdb670b0e8e7b3 Mon Sep 17 00:00:00 2001 From: Andrew Murray Date: Tue, 30 May 2017 19:55:35 +1000 Subject: [PATCH 2/2] Replaced deprecated assert_ --- Tests/test_image.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/test_image.py b/Tests/test_image.py index 27f5ad885..156396451 100644 --- a/Tests/test_image.py +++ b/Tests/test_image.py @@ -390,7 +390,7 @@ class TestRegistry(PillowTestCase): def test_encode_registry(self): Image.register_encoder('MOCK', mock_encode) - self.assert_('MOCK' in Image.ENCODERS) + self.assertIn('MOCK', Image.ENCODERS) enc = Image._getencoder('RGB', 'MOCK', ('args',), extra=('extra',))