public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] test/py: Fix exception, do not parametrize with empty set
@ 2016-10-16 18:17 Stefan Brüns
  2016-10-17 18:11 ` Stephen Warren
  2016-10-17 22:59 ` Stephen Warren
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Brüns @ 2016-10-16 18:17 UTC (permalink / raw)
  To: u-boot

If the parameter set is empty, the pytest setup fails:
---
    call: <CallInfo when='setup' exception: got empty parameter set
    ['env__dfu_config'], function test_dfu@[...]test_dfu.py:107>
---

This aborts pytest_runtest_makereport and later leads to an exception
during the report generation, as the call to log.start_section(...)
is never executed:
---
    Exception: Block nesting mismatch:
    "test_dfu[env__usb_dev_port0-env__dfu_config0]" ""
---

Signed-off-by: Stefan Br?ns <stefan.bruens@rwth-aachen.de>
---
 test/py/conftest.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/test/py/conftest.py b/test/py/conftest.py
index 5b3a923..ebef40d 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -270,6 +270,8 @@ def generate_config(metafunc, fixture_name):
         # ... otherwise, see if there's a key that contains a list of
         # values to use instead.
         vals = subconfig.get(fixture_name+ 's', [])
+    if len(vals) == 0:
+        return
     def fixture_id(index, val):
         try:
             return val['fixture_id']
-- 
2.10.1

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

end of thread, other threads:[~2016-10-17 22:59 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-16 18:17 [U-Boot] [PATCH] test/py: Fix exception, do not parametrize with empty set Stefan Brüns
2016-10-17 18:11 ` Stephen Warren
2016-10-17 19:18   ` Brüns, Stefan
2016-10-17 22:01     ` Stephen Warren
2016-10-17 22:21       ` Stephen Warren
2016-10-17 22:59 ` Stephen Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox