diff options
-rw-r--r-- | tests/sources/fixture.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/sources/fixture.py b/tests/sources/fixture.py index 9a558ecc0..20025f46c 100644 --- a/tests/sources/fixture.py +++ b/tests/sources/fixture.py @@ -6,6 +6,10 @@ from buildstream._loader import Loader from buildstream._sourcefactory import SourceFactory +def message_handler(message, context): + print("{}".format(message.message)) + + # Hacked hand fashioned fixture, just a helper function # because its tricky to have a pytest fixture take arguments # @@ -20,6 +24,9 @@ class Setup(): self.context = Context('x86_64') self.project = Project(directory, 'x86_64') + # A message handler is required + self.context._set_message_handler(message_handler) + self.context.sourcedir = os.path.join(str(tmpdir), 'sources') self.context.builddir = os.path.join(str(tmpdir), 'build') |