Closes #76. Issue was inapplicable.

Patching the library handle wasn't appropriate since the tests are
really concerned with reloading the entire package.  imp.reload in
setUpClass and tearDownClass really was the correct way to go.
This commit is contained in:
jevans 2013-07-16 19:52:10 -04:00
commit 196bb9de47
2 changed files with 7 additions and 10 deletions

View file

@ -25,6 +25,7 @@ import glymur
from glymur import Jp2k
from glymur.lib import openjp2 as opj2
@unittest.skipIf(sys.hexversion < 0x03020000,
"TemporaryDirectory introduced in 3.2.")
@unittest.skipIf(glymur.lib.openjp2.OPENJP2 is None,
@ -33,23 +34,19 @@ class TestSuite(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Monkey patch the package so as to ignore OPENJPEG if it exists.
cls.openjpeg = glymur.lib.openjpeg.OPENJPEG
glymur.lib.openjpeg.OPENJPEG = None
imp.reload(glymur)
imp.reload(glymur.lib.openjp2)
@classmethod
def tearDownClass(cls):
# Restore OPENJPEG
glymur.lib.openjpeg.OPENJPEG = cls.openjpeg
def setUp(self):
imp.reload(glymur)
imp.reload(glymur.lib.openjp2)
def setUp(self):
self.jp2file = glymur.data.nemo()
def tearDown(self):
imp.reload(glymur)
imp.reload(glymur.lib.openjp2)
pass
def test_config_file_via_environ(self):
"""Verify that we can read a configuration file set via environ var."""

View file

@ -216,7 +216,7 @@ class TestSuite(unittest.TestCase):
'baseline/conformance/c0p0_13.pgx')
pgxdata = read_pgx(pgxfile)
np.testing.assert_array_equal(jpdata[:,:,0], pgxdata)
np.testing.assert_array_equal(jpdata[:, :, 0], pgxdata)
@unittest.skip("Known failure in OPENJPEG test suite.")
def test_ETS_C0P0_p0_14_j2k(self):