Skip to contentSkip to conversation

tests/acceptance: move @skipUnless decoration to test itself

PATCH In review Philippe Mathieu-Daudé 3 participants 3 messages Mar 2, 2020 – Mar 3, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/acceptance: move @skipUnless decoration to test itself

From: Alex Bennée <[email protected]>

It appears ignore the decoration if just applied to the class.

Fixes 0484d9d4fbe9beacd
[PMD: Move decorations to each test function]
---
 tests/acceptance/machine_mips_malta.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tests/acceptance/machine_mips_malta.py +6 -2
index 92b4f28a11..98463f7757 100644
@@ -30,8 +30,6 @@
     CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
 class MaltaMachineFramebuffer(Test):
 
     timeout = 30
@@ -91,6 +89,8 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count):
             cv2.imwrite(debug_png, screendump_bgr)
         self.assertGreaterEqual(tuxlogo_count, cpu_cores_count)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_1core(self):
         """
         :avocado: tags=arch:mips64el
@@ -99,6 +99,8 @@ def test_mips_malta_i6400_framebuffer_logo_1core(self):
         """
         self.do_test_i6400_framebuffer_logo(1)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_7cores(self):
         """
         :avocado: tags=arch:mips64el
@@ -108,6 +110,8 @@ def test_mips_malta_i6400_framebuffer_logo_7cores(self):
         """
         self.do_test_i6400_framebuffer_logo(7)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_8cores(self):
         """
         :avocado: tags=arch:mips64el
Signature · 1 line
2.21.1
Reviewed-by on v1 1/1
#1 lore raw

12:22 AM Uto, 03.03.2020. Philippe Mathieu-Daudé <[email protected]> је написао/ла:

Quoted 10 lines

From: Alex Bennée <[email protected]>

It appears ignore the decoration if just applied to the class.

Fixes 0484d9d4fbe9beacd
[PMD: Move decorations to each test function]

---

Alex, please accept this most complete version. Many thanks, Aleksandar

Review

Quoted 4 lines
 tests/acceptance/machine_mips_malta.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/tests/acceptance/machine_mips_malta.py

tests/acceptance/machine_mips_malta.py def do_test_i6400_framebuffer_logo(self,

Quoted 13 lines

index 92b4f28a11..98463f7757 100644

tests/acceptance/machine_mips_malta.py +0 -2
@@ -30,8 +30,6 @@
     CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
 class MaltaMachineFramebuffer(Test):
 
     timeout = 30
@@ -91,6 +89,8 @@ def do_test_i6400_framebuffer_logo(self,

cpu_cores_count):

tests/acceptance/machine_mips_malta.py def

Quoted 18 lines
tests/acceptance/machine_mips_malta.py +4 -0
             cv2.imwrite(debug_png, screendump_bgr)
         self.assertGreaterEqual(tuxlogo_count, cpu_cores_count)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_1core(self):
         """
         :avocado: tags=arch:mips64el
@@ -99,6 +99,8 @@ def test_mips_malta_i6400_framebuffer_logo_1core(self):
         """
         self.do_test_i6400_framebuffer_logo(1)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_7cores(self):
         """
         :avocado: tags=arch:mips64el
@@ -108,6 +110,8 @@ def

test_mips_malta_i6400_framebuffer_logo_7cores(self):

Quoted 12 lines
tests/acceptance/machine_mips_malta.py +2 -1
         """
         self.do_test_i6400_framebuffer_logo(7)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_8cores(self):
         """
         :avocado: tags=arch:mips64el
--

2.21.1

#2 lore raw
Quoted 13 lines · Aleksandar Markovic

12:22 AM Uto, 03.03.2020. Philippe Mathieu-Daudé <[email protected]> је написао/ла:

Quoted 10 lines

From: Alex Bennée <[email protected]>

It appears ignore the decoration if just applied to the class.

Fixes 0484d9d4fbe9beacd
[PMD: Move decorations to each test function]

---

Quoted 4 lines

Alex, please accept this most complete version. Many thanks, Aleksandar

Queued to testing/next, thanks.

Quoted 51 lines

Review

Quoted 5 lines
 tests/acceptance/machine_mips_malta.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/tests/acceptance/machine_mips_malta.py

tests/acceptance/machine_mips_malta.py def do_test_i6400_framebuffer_logo(self,

Quoted 13 lines

index 92b4f28a11..98463f7757 100644

tests/acceptance/machine_mips_malta.py +0 -2
@@ -30,8 +30,6 @@
     CV2_AVAILABLE = False
 
 
-@skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
-@skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
 class MaltaMachineFramebuffer(Test):
 
     timeout = 30
@@ -91,6 +89,8 @@ def do_test_i6400_framebuffer_logo(self,

cpu_cores_count):

tests/acceptance/machine_mips_malta.py def

Quoted 18 lines
tests/acceptance/machine_mips_malta.py +4 -0
             cv2.imwrite(debug_png, screendump_bgr)
         self.assertGreaterEqual(tuxlogo_count, cpu_cores_count)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_1core(self):
         """
         :avocado: tags=arch:mips64el
@@ -99,6 +99,8 @@ def test_mips_malta_i6400_framebuffer_logo_1core(self):
         """
         self.do_test_i6400_framebuffer_logo(1)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_7cores(self):
         """
         :avocado: tags=arch:mips64el
@@ -108,6 +110,8 @@ def

test_mips_malta_i6400_framebuffer_logo_7cores(self):

Quoted 12 lines
tests/acceptance/machine_mips_malta.py +2 -1
         """
         self.do_test_i6400_framebuffer_logo(7)
 
+    @skipUnless(NUMPY_AVAILABLE, 'Python NumPy not installed')
+    @skipUnless(CV2_AVAILABLE, 'Python OpenCV not installed')
     def test_mips_malta_i6400_framebuffer_logo_8cores(self):
         """
         :avocado: tags=arch:mips64el
--

2.21.1

Signature · 1 line
Alex Bennée