All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] test: py: Use global pytestmark for hush tests
@ 2017-05-17  9:17 Michal Simek
  2017-05-17 15:08 ` Stephen Warren
  0 siblings, 1 reply; 3+ messages in thread
From: Michal Simek @ 2017-05-17  9:17 UTC (permalink / raw)
  To: u-boot

All tests in test_hush_if_test depends on hush parser
to be present.
This patch simplify test dependencies by using global
pytestmark.

Reported-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 test/py/tests/test_hush_if_test.py | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/test/py/tests/test_hush_if_test.py b/test/py/tests/test_hush_if_test.py
index b572538528e1..056a2880303e 100644
--- a/test/py/tests/test_hush_if_test.py
+++ b/test/py/tests/test_hush_if_test.py
@@ -8,6 +8,8 @@ import os
 import os.path
 import pytest
 
+pytestmark = pytest.mark.buildconfigspec('hush_parser')
+
 # The list of "if test" conditions to test.
 subtests = (
     # Base if functionality.
@@ -109,27 +111,23 @@ def exec_hush_if(u_boot_console, expr, result):
     response = u_boot_console.run_command(cmd)
     assert response.strip() == str(result).lower()
 
- at pytest.mark.buildconfigspec('hush_parser')
 def test_hush_if_test_setup(u_boot_console):
     """Set up environment variables used during the "if" tests."""
 
     u_boot_console.run_command('setenv ut_var_nonexistent')
     u_boot_console.run_command('setenv ut_var_exists 1')
 
- at pytest.mark.buildconfigspec('hush_parser')
 @pytest.mark.parametrize('expr,result', subtests)
 def test_hush_if_test(u_boot_console, expr, result):
     """Test a single "if test" condition."""
 
     exec_hush_if(u_boot_console, expr, result)
 
- at pytest.mark.buildconfigspec('hush_parser')
 def test_hush_if_test_teardown(u_boot_console):
     """Clean up environment variables used during the "if" tests."""
 
     u_boot_console.run_command('setenv ut_var_exists')
 
- at pytest.mark.buildconfigspec('hush_parser')
 # We might test this on real filesystems via UMS, DFU, 'save', etc.
 # Of those, only UMS currently allows file removal though.
 @pytest.mark.boardspec('sandbox')
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] test: py: Use global pytestmark for hush tests
  2017-05-17  9:17 [U-Boot] [PATCH] test: py: Use global pytestmark for hush tests Michal Simek
@ 2017-05-17 15:08 ` Stephen Warren
  2017-05-17 15:23   ` Michal Simek
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Warren @ 2017-05-17 15:08 UTC (permalink / raw)
  To: u-boot

On 05/17/2017 03:17 AM, Michal Simek wrote:
> All tests in test_hush_if_test depends on hush parser
> to be present.
> This patch simplify test dependencies by using global
> pytestmark.

Nit: That seems to have been accidentally line-wrapped.

> diff --git a/test/py/tests/test_hush_if_test.py b/test/py/tests/test_hush_if_test.py

> +pytestmark = pytest.mark.buildconfigspec('hush_parser')

This is fine to unify the marking, but I was actually talking about 
adding a new dependency on cmd_echo, which I assume can be turned off 
even with hush_parser enabled?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH] test: py: Use global pytestmark for hush tests
  2017-05-17 15:08 ` Stephen Warren
@ 2017-05-17 15:23   ` Michal Simek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Simek @ 2017-05-17 15:23 UTC (permalink / raw)
  To: u-boot

On 17.5.2017 17:08, Stephen Warren wrote:
> On 05/17/2017 03:17 AM, Michal Simek wrote:
>> All tests in test_hush_if_test depends on hush parser
>> to be present.
>> This patch simplify test dependencies by using global
>> pytestmark.
> 
> Nit: That seems to have been accidentally line-wrapped.
> 
>> diff --git a/test/py/tests/test_hush_if_test.py
>> b/test/py/tests/test_hush_if_test.py
> 
>> +pytestmark = pytest.mark.buildconfigspec('hush_parser')
> 
> This is fine to unify the marking, but I was actually talking about
> adding a new dependency on cmd_echo, which I assume can be turned off
> even with hush_parser enabled?

Definitely dependencies should be for both.

Thanks,
Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-05-17 15:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17  9:17 [U-Boot] [PATCH] test: py: Use global pytestmark for hush tests Michal Simek
2017-05-17 15:08 ` Stephen Warren
2017-05-17 15:23   ` Michal Simek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.