test/py: Handle a failure during configuration

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>
This commit is contained in:
Simon Glass
2026-01-02 08:17:58 -07:00
parent a603e20179
commit 022b1694af

View File

@@ -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'):