Commit 0d3be1a7 authored by Julia Garriga Ferrer's avatar Julia Garriga Ferrer
Browse files

[core][tests] Skip sift tests unless pyopencl is installed

parent 4b813c82
Pipeline #22344 passed with stage
in 2 minutes and 25 seconds
...@@ -33,6 +33,8 @@ import unittest ...@@ -33,6 +33,8 @@ import unittest
import numpy import numpy
from silx.opencl.common import ocl
from darfix.core.componentsMatching import ComponentsMatching, Method from darfix.core.componentsMatching import ComponentsMatching, Method
from skimage import data from skimage import data
...@@ -63,6 +65,7 @@ class TestComponentsMatching(unittest.TestCase): ...@@ -63,6 +65,7 @@ class TestComponentsMatching(unittest.TestCase):
self.assertNotEqual(ed, 0) self.assertNotEqual(ed, 0)
@unittest.skipUnless(ocl, "PyOpenCl is missing")
def test_sift_match(self): def test_sift_match(self):
final_matches, matches = self.componentsMatching.match_components(method=Method.sift_feature_matching) final_matches, matches = self.componentsMatching.match_components(method=Method.sift_feature_matching)
self.assertEqual(final_matches[0], 1) self.assertEqual(final_matches[0], 1)
...@@ -83,6 +86,7 @@ class TestComponentsMatching(unittest.TestCase): ...@@ -83,6 +86,7 @@ class TestComponentsMatching(unittest.TestCase):
stack = self.componentsMatching.draw_matches(final_matches, matches) stack = self.componentsMatching.draw_matches(final_matches, matches)
self.assertEqual(stack[2].shape, (512, 1024)) self.assertEqual(stack[2].shape, (512, 1024))
@unittest.skipUnless(ocl, "PyOpenCl is missing")
def test_draw_matches2(self): def test_draw_matches2(self):
final_matches, matches = self.componentsMatching.match_components(method=Method.sift_feature_matching) final_matches, matches = self.componentsMatching.match_components(method=Method.sift_feature_matching)
stack = self.componentsMatching.draw_matches(final_matches, matches) stack = self.componentsMatching.draw_matches(final_matches, matches)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment