diff mbox series

[4/7] lib/bb/tests/setup.py: unset BBPATH to ensure isolation from the existing bitbake environment

Message ID 20251002100929.1054540-4-alex.kanavin@gmail.com
State New
Headers show
Series [1/7] bitbake-setup: suggest "." instead of "source" | expand

Commit Message

Alexander Kanavin Oct. 2, 2025, 10:09 a.m. UTC
From: Alexander Kanavin <alex@linutronix.de>

bitbake-setup deduces top directory from BBPATH, which, if set, interferes with
the tests' own setup.

Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 lib/bb/tests/setup.py | 5 +++++
 1 file changed, 5 insertions(+)
diff mbox series

Patch

diff --git a/lib/bb/tests/setup.py b/lib/bb/tests/setup.py
index c77e750db..2076613d9 100644
--- a/lib/bb/tests/setup.py
+++ b/lib/bb/tests/setup.py
@@ -181,6 +181,11 @@  print("BBPATH is {{}}".format(os.environ["BBPATH"]))
 
 
     def test_setup(self):
+        # unset BBPATH to ensure tests run in isolation from the existing bitbake environment
+        import os
+        if 'BBPATH' in os.environ:
+            del os.environ['BBPATH']
+
         # check that no arguments works
         self.runbbsetup("")