From ef82e45c2ef5278493576708d6aafd686ba77af9 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 May 2025 08:14:51 -0600 Subject: test/py: Use the correct fixture name in exception handler If a BootFail exception is thrown in a test, it is not handled correctly. Use the correct fixture variable 'ubman_fix' to resolve this. Signed-off-by: Simon Glass Fixes: d9ed4b75add ("test/py: Drop u_boot_ prefix on test files") Reviewed-by: Mattijs Korpershoek --- test/py/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/py/conftest.py') diff --git a/test/py/conftest.py b/test/py/conftest.py index 6c3ac67979a..eec0b5488e4 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -514,7 +514,7 @@ def ubman(request): handle_exception(ubconfig, ubman_fix, log, err, 'Lab timeout', True) except BootFail as err: handle_exception(ubconfig, ubman_fix, log, err, 'Boot fail', True, - ubman.get_spawn_output()) + ubman_fix.get_spawn_output()) except Unexpected: handle_exception(ubconfig, ubman_fix, log, err, 'Unexpected test output', False) -- cgit v1.2.3 From 2ab10ed2399b0c1c790733884935c94ad65aa2a8 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Thu, 29 May 2025 08:14:52 -0600 Subject: test/py: Correct handling of exceptions If an Unexpected exception is thrown in a test, an undefined variable error is reported. Fix this. Signed-off-by: Simon Glass Fixes: 85d7dae377a ("test: Detect dead connections") Reviewed-by: Mattijs Korpershoek --- test/py/conftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/py/conftest.py') diff --git a/test/py/conftest.py b/test/py/conftest.py index eec0b5488e4..8ce680a92a0 100644 --- a/test/py/conftest.py +++ b/test/py/conftest.py @@ -515,7 +515,7 @@ def ubman(request): except BootFail as err: handle_exception(ubconfig, ubman_fix, log, err, 'Boot fail', True, ubman_fix.get_spawn_output()) - except Unexpected: + except Unexpected as err: handle_exception(ubconfig, ubman_fix, log, err, 'Unexpected test output', False) return ubman_fix -- cgit v1.2.3