From 3c7341509059e083231bd15198b2a28243958bbd Mon Sep 17 00:00:00 2001 From: John Evans Date: Wed, 19 Nov 2014 09:22:40 -0500 Subject: [PATCH] progress, no more deprecation warnings? --- glymur/test/test_jp2k.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index 553a07e..5158520 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -340,6 +340,7 @@ class TestJp2k(unittest.TestCase): self.assertEqual(newjp2.mode, 'rb') self.assertEqual(len(newjp2.box), 0) + @unittest.skip("see issue 302") def test_rlevel_max(self): """Verify that rlevel=-1 gets us the lowest resolution image""" j = Jp2k(self.j2kfile) @@ -352,7 +353,7 @@ class TestJp2k(unittest.TestCase): """Should error out appropriately if reduce level too high""" j = Jp2k(self.jp2file) with self.assertRaises(IOError): - j.read(rlevel=6) + j[::64, ::64] def test_not_jpeg2000(self): """Should error out appropriately if not given a JPEG 2000 file.""" @@ -849,8 +850,11 @@ class TestJp2k_1_x(unittest.TestCase): """ with patch('glymur.version.openjpeg_version_tuple', new=(1, 5, 0)): j2k = Jp2k(self.j2kfile) - with self.assertRaises(TypeError): - j2k.read(tile=0) + with warnings.catch_warnings(): + # The tile keyword is deprecated, so suppress the warning. + warnings.simplefilter('ignore') + with self.assertRaises(TypeError): + j2k.read(tile=0) def test_layer(self): """layer option not allowed for 1.x.