summaryrefslogtreecommitdiff
path: root/tests/loader/__init__.py
blob: 812888181c4002c4ea3434c813736fb50fd1a2ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import os
from buildstream._context import Context
from buildstream._project import Project
from buildstream._loader import Loader

#
# This is used by the loader test modules, these should
# be removed in favor of testing the functionality via
# the CLI like in the frontend tests anyway.
#


def dummy_handler(message, context):
    pass


def make_loader(basedir):
    context = Context()
    context.load(config=os.devnull)
    context.set_message_handler(dummy_handler)
    project = Project(basedir, context)
    return project.loader