tests/acceptance: move @skipUnless decoration to test itself

Message ID 20200302232220.761-1-philmd@redhat.com
State New
Headers show
Series
  • tests/acceptance: move @skipUnless decoration to test itself
Related show

Commit Message

Philippe Mathieu-Daudé March 2, 2020, 11:22 p.m.
From: Alex Bennée <alex.bennee@linaro.org>


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

Fixes: 0484d9d4fbe9beacd
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

[PMD: Move decorations to each test function]
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

---
 tests/acceptance/machine_mips_malta.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

-- 
2.21.1

Comments

Aleksandar Markovic March 3, 2020, 9:42 a.m. | #1
12:22 AM Uto, 03.03.2020. Philippe Mathieu-Daudé <philmd@redhat.com> је
написао/ла:
>

> From: Alex Bennée <alex.bennee@linaro.org>

>

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

>

> Fixes: 0484d9d4fbe9beacd

> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

> [PMD: Move decorations to each test function]

> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---


Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>


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

>  tests/acceptance/machine_mips_malta.py | 8 ++++++--

>  1 file changed, 6 insertions(+), 2 deletions(-)

>

> diff --git a/tests/acceptance/machine_mips_malta.py

b/tests/acceptance/machine_mips_malta.py
> index 92b4f28a11..98463f7757 100644

> --- a/tests/acceptance/machine_mips_malta.py

> +++ b/tests/acceptance/machine_mips_malta.py

> @@ -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

> --

> 2.21.1

>

>
<p dir="ltr"></p>
<p dir="ltr">12:22 AM Uto, 03.03.2020. Philippe Mathieu-Daudé &lt;<a href="mailto:philmd@redhat.com">philmd@redhat.com</a>&gt; је написао/ла:<br>
&gt;<br>
&gt; From: Alex Bennée &lt;<a href="mailto:alex.bennee@linaro.org">alex.bennee@linaro.org</a>&gt;<br>
&gt;<br>
&gt; It appears ignore the decoration if just applied to the class.<br>
&gt;<br>
&gt; Fixes: 0484d9d4fbe9beacd<br>
&gt; Signed-off-by: Alex Bennée &lt;<a href="mailto:alex.bennee@linaro.org">alex.bennee@linaro.org</a>&gt;<br>
&gt; [PMD: Move decorations to each test function]<br>
&gt; Signed-off-by: Philippe Mathieu-Daudé &lt;<a href="mailto:philmd@redhat.com">philmd@redhat.com</a>&gt;<br>
&gt; ---</p>
<p dir="ltr">Reviewed-by: Aleksandar Markovic &lt;<a href="mailto:amarkovic@wavecomp.com">amarkovic@wavecomp.com</a>&gt;</p>
<p dir="ltr">Alex, please accept this most complete version. Many thanks, Aleksandar<br></p>
<p dir="ltr">&gt;  tests/acceptance/machine_mips_malta.py | 8 ++++++--<br>
&gt;  1 file changed, 6 insertions(+), 2 deletions(-)<br>
&gt;<br>
&gt; diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/machine_mips_malta.py<br>
&gt; index 92b4f28a11..98463f7757 100644<br>
&gt; --- a/tests/acceptance/machine_mips_malta.py<br>
&gt; +++ b/tests/acceptance/machine_mips_malta.py<br>
&gt; @@ -30,8 +30,6 @@<br>
&gt;      CV2_AVAILABLE = False<br>
&gt;<br>
&gt;<br>
&gt; -@skipUnless(NUMPY_AVAILABLE, &#39;Python NumPy not installed&#39;)<br>
&gt; -@skipUnless(CV2_AVAILABLE, &#39;Python OpenCV not installed&#39;)<br>
&gt;  class MaltaMachineFramebuffer(Test):<br>
&gt;<br>
&gt;      timeout = 30<br>
&gt; @@ -91,6 +89,8 @@ def do_test_i6400_framebuffer_logo(self, cpu_cores_count):<br>
&gt;              cv2.imwrite(debug_png, screendump_bgr)<br>
&gt;          self.assertGreaterEqual(tuxlogo_count, cpu_cores_count)<br>
&gt;<br>
&gt; +    @skipUnless(NUMPY_AVAILABLE, &#39;Python NumPy not installed&#39;)<br>
&gt; +    @skipUnless(CV2_AVAILABLE, &#39;Python OpenCV not installed&#39;)<br>
&gt;      def test_mips_malta_i6400_framebuffer_logo_1core(self):<br>
&gt;          &quot;&quot;&quot;<br>
&gt;          :avocado: tags=arch:mips64el<br>
&gt; @@ -99,6 +99,8 @@ def test_mips_malta_i6400_framebuffer_logo_1core(self):<br>
&gt;          &quot;&quot;&quot;<br>
&gt;          self.do_test_i6400_framebuffer_logo(1)<br>
&gt;<br>
&gt; +    @skipUnless(NUMPY_AVAILABLE, &#39;Python NumPy not installed&#39;)<br>
&gt; +    @skipUnless(CV2_AVAILABLE, &#39;Python OpenCV not installed&#39;)<br>
&gt;      def test_mips_malta_i6400_framebuffer_logo_7cores(self):<br>
&gt;          &quot;&quot;&quot;<br>
&gt;          :avocado: tags=arch:mips64el<br>
&gt; @@ -108,6 +110,8 @@ def test_mips_malta_i6400_framebuffer_logo_7cores(self):<br>
&gt;          &quot;&quot;&quot;<br>
&gt;          self.do_test_i6400_framebuffer_logo(7)<br>
&gt;<br>
&gt; +    @skipUnless(NUMPY_AVAILABLE, &#39;Python NumPy not installed&#39;)<br>
&gt; +    @skipUnless(CV2_AVAILABLE, &#39;Python OpenCV not installed&#39;)<br>
&gt;      def test_mips_malta_i6400_framebuffer_logo_8cores(self):<br>
&gt;          &quot;&quot;&quot;<br>
&gt;          :avocado: tags=arch:mips64el<br>
&gt; -- <br>
&gt; 2.21.1<br>
&gt;<br>
&gt;<br>
</p>
Alex Bennée March 3, 2020, 10:24 a.m. | #2
Aleksandar Markovic <aleksandar.m.mail@gmail.com> writes:

> 12:22 AM Uto, 03.03.2020. Philippe Mathieu-Daudé <philmd@redhat.com> је

> написао/ла:

>>

>> From: Alex Bennée <alex.bennee@linaro.org>

>>

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

>>

>> Fixes: 0484d9d4fbe9beacd

>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>

>> [PMD: Move decorations to each test function]

>> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>

>> ---

>

> Reviewed-by: Aleksandar Markovic <amarkovic@wavecomp.com>

>

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

> Aleksandar


Queued to testing/next, thanks.

>

>>  tests/acceptance/machine_mips_malta.py | 8 ++++++--

>>  1 file changed, 6 insertions(+), 2 deletions(-)

>>

>> diff --git a/tests/acceptance/machine_mips_malta.py

> b/tests/acceptance/machine_mips_malta.py

>> index 92b4f28a11..98463f7757 100644

>> --- a/tests/acceptance/machine_mips_malta.py

>> +++ b/tests/acceptance/machine_mips_malta.py

>> @@ -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

>> --

>> 2.21.1

>>

>>



-- 
Alex Bennée

Patch

diff --git a/tests/acceptance/machine_mips_malta.py b/tests/acceptance/machine_mips_malta.py
index 92b4f28a11..98463f7757 100644
--- a/tests/acceptance/machine_mips_malta.py
+++ b/tests/acceptance/machine_mips_malta.py
@@ -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