diff options
author | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
---|---|---|
committer | Picca Frédéric-Emmanuel <picca@synchrotron-soleil.fr> | 2019-05-28 08:16:16 +0200 |
commit | 7287b75301a53bae723579b145448d43304272af (patch) | |
tree | df6d1a4595f3352a8c90ce9cba0e71ea0269e98b /silx/sx/test/test_sx.py | |
parent | 3e5dcad207c1eadeb74fb53f524c3a94fbe19096 (diff) | |
parent | a763e5d1b3921b3194f3d4e94ab9de3fbe08bbdd (diff) |
Update upstream source from tag 'upstream/0.10.1+dfsg'
Update to upstream version '0.10.1+dfsg'
with Debian dir 6b2d4eeabb68177b2b91df4d7527306d5e19409d
Diffstat (limited to 'silx/sx/test/test_sx.py')
-rw-r--r-- | silx/sx/test/test_sx.py | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/silx/sx/test/test_sx.py b/silx/sx/test/test_sx.py index d264779..ec95838 100644 --- a/silx/sx/test/test_sx.py +++ b/silx/sx/test/test_sx.py @@ -24,7 +24,7 @@ # ###########################################################################*/ __authors__ = ["T. Vincent", "P. Knobel"] __license__ = "MIT" -__date__ = "05/10/2018" +__date__ = "06/11/2018" import logging @@ -38,8 +38,16 @@ from silx.gui import qt # load TestCaseQt before sx from silx.gui.utils.testutils import TestCaseQt from silx.gui.colors import rgba +from silx.gui.colors import Colormap from silx import sx +try: + import OpenGL +except ImportError: + has_opengl = False +else: + has_opengl = True + _logger = logging.getLogger(__name__) @@ -109,10 +117,14 @@ class SXTest(TestCaseQt, ParametricTestCase): plt = sx.imshow(img) self._expose_and_close(plt) - # image, gray cmap + # image, named cmap plt = sx.imshow(img, cmap='jet', title='jet cmap') self._expose_and_close(plt) + # image, custom colormap + plt = sx.imshow(img, cmap=Colormap(), title='custom colormap') + self._expose_and_close(plt) + # image, log cmap plt = sx.imshow(img, norm='log', title='log cmap') self._expose_and_close(plt) @@ -188,6 +200,7 @@ class SXTest(TestCaseQt, ParametricTestCase): plt.setAttribute(qt.Qt.WA_DeleteOnClose) plt.close() + @unittest.skipUnless(has_opengl, 'OpenGL not installed') @unittest.skipUnless(test_options.WITH_GL_TEST, test_options.WITH_GL_TEST_REASON) def test_contour3d(self): @@ -239,6 +252,7 @@ class SXTest(TestCaseQt, ParametricTestCase): self.assertEqual(rgba(isosurfaces[0].getColor()), (0., 0., 0., 0.4)) + @unittest.skipUnless(has_opengl, 'OpenGL not installed') @unittest.skipUnless(test_options.WITH_GL_TEST, test_options.WITH_GL_TEST_REASON) def test_points3d(self): |