diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-12 15:26:52 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-03-12 15:28:47 +0000 |
commit | 426eb83c6668d82a2ebaca6c672db131e37c11da (patch) | |
tree | eb1d0cd250338fc023b1e2d7d0a6603abed0ee86 | |
parent | c3f6fee42bfa23f23f167cb29f0cfa05ac2fa197 (diff) | |
download | bitbake-contrib-426eb83c6668d82a2ebaca6c672db131e37c11da.tar.gz |
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.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | lib/bb/tests/color.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/bb/tests/color.py b/lib/bb/tests/color.py index bf03750c6..88dd27800 100644 --- a/lib/bb/tests/color.py +++ b/lib/bb/tests/color.py @@ -31,7 +31,7 @@ class ColorCodeTests(unittest.TestCase): def setUp(self): self.d = bb.data.init() self._progress_watcher = ProgressWatcher() - bb.event.register("bb.build.TaskProgress", self._progress_watcher.handle_event) + bb.event.register("bb.build.TaskProgress", self._progress_watcher.handle_event, data=self.d) def tearDown(self): bb.event.remove("bb.build.TaskProgress", None) |