summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-12 15:26:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-03-12 15:28:57 +0000
commitcca5433bafb2d7efc7d93a43bdf02e4f53534fd5 (patch)
tree30e4cf61699da0300ea85950d3296fc2cf55a735 /bitbake
parent22d7989e8f3871553e57909b8e031b6b17dcb0e0 (diff)
downloadpoky-cca5433bafb2d7efc7d93a43bdf02e4f53534fd5.tar.gz
bitbake: tests/color: Fix event register to pass the datastore
Adding the "if d is None" to the event handling code meant some of these tests stopped working. The reason is that len(d) was zero but not equal to None. Passing the data object to the register() function in the test correctly registers the event handler and avoids the problem, it just happened to work previously, incorrectly. (Bitbake rev: 426eb83c6668d82a2ebaca6c672db131e37c11da) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/tests/color.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/tests/color.py b/bitbake/lib/bb/tests/color.py
index bf03750c69..88dd278006 100644
--- a/bitbake/lib/bb/tests/color.py
+++ b/bitbake/lib/bb/tests/color.py
@@ -31,7 +31,7 @@ class ColorCodeTests(unittest.TestCase):
31 def setUp(self): 31 def setUp(self):
32 self.d = bb.data.init() 32 self.d = bb.data.init()
33 self._progress_watcher = ProgressWatcher() 33 self._progress_watcher = ProgressWatcher()
34 bb.event.register("bb.build.TaskProgress", self._progress_watcher.handle_event) 34 bb.event.register("bb.build.TaskProgress", self._progress_watcher.handle_event, data=self.d)
35 35
36 def tearDown(self): 36 def tearDown(self):
37 bb.event.remove("bb.build.TaskProgress", None) 37 bb.event.remove("bb.build.TaskProgress", None)