[Concept,v2,25/29] test/py: Handle a failure during configuration

Message ID 20260103200510.3605009-26-sjg@u-boot.org
State New
Headers
Series Malloc debugging and test/py improvements |

Commit Message

Simon Glass Jan. 3, 2026, 8:04 p.m. UTC
  From: Simon Glass <simon.glass@canonical.com>

If the build does not exist we can get an error when starting up:

  INTERNALERROR> Exception: .config does not exist; try passing --build
    option?
  Exception ignored in atexit callback: <function cleanup at ...>
  Traceback (most recent call last):
    File "test/py/conftest.py", line 697, in cleanup
    show_timings()
  File "test/py/conftest.py", line 644, in show_timings
    if ubconfig and ubconfig.timing:
                    ^^^^^^^^^^^^^^^
Fix this by setting up the timing member at the start.

Signed-off-by: Simon Glass <simon.glass@canonical.com>
---

(no changes since v1)

 test/py/conftest.py | 1 +
 1 file changed, 1 insertion(+)
  

Patch

diff --git a/test/py/conftest.py b/test/py/conftest.py
index b79080af961..0060f3da986 100644
--- a/test/py/conftest.py
+++ b/test/py/conftest.py
@@ -301,6 +301,7 @@  def pytest_configure(config):
     ubconfig = ArbitraryAttributeContainer()
     ubconfig.brd = dict()
     ubconfig.env = dict()
+    ubconfig.timing = None
     not_found = []
 
     with log.section('Loading lab modules', 'load_modules'):