示例#1
0
    def _init_options(self, kwargs):
        super(Robot, self)._init_options(kwargs)

        for option in ("test", "include", "exclude", "vars"):
            if option in self.options:
                self.options[option] = process_list_arg(self.options[option])
        if "vars" not in self.options:
            self.options["vars"] = []

        # Initialize options as a dict
        if "options" not in self.options:
            self.options["options"] = {}

        # There are potentially many robot options that are or could
        # be lists, but the only one we currently care about is the
        # listener option since we may need to append additional values
        # onto it.
        for option in ("listener",):
            if option in self.options["options"]:
                self.options["options"][option] = process_list_arg(
                    self.options["options"][option]
                )

        listeners = self.options["options"].setdefault("listener", [])
        if process_bool_arg(self.options.get("verbose")):
            listeners.append(KeywordLogger())

        if process_bool_arg(self.options.get("debug")):
            listeners.append(DebugListener())

        if process_bool_arg(self.options.get("pdb")):
            patch_statusreporter()
示例#2
0
    def _init_options(self, kwargs):
        super(Robot, self)._init_options(kwargs)

        for option in ("test", "include", "exclude", "vars", "sources", "suites"):
            if option in self.options:
                self.options[option] = process_list_arg(self.options[option])
        if "vars" not in self.options:
            self.options["vars"] = []

        # Initialize options as a dict
        if "options" not in self.options:
            self.options["options"] = {}

        # processes needs to be an integer.
        try:
            self.options["processes"] = int(self.options.get("processes", 1))
        except (TypeError, ValueError):
            raise TaskOptionsError(
                "Please specify an integer for the `processes` option."
            )

        # There are potentially many robot options that are or could
        # be lists, but the only one we currently care about is the
        # listener option since we may need to append additional values
        # onto it.
        for option in ("listener",):
            if option in self.options["options"]:
                self.options["options"][option] = process_list_arg(
                    self.options["options"][option]
                )

        listeners = self.options["options"].setdefault("listener", [])
        if process_bool_arg(self.options.get("verbose") or False):
            listeners.append(KeywordLogger())

        if process_bool_arg(self.options.get("debug") or False):
            listeners.append(DebugListener())

        if process_bool_arg(self.options.get("pdb") or False):
            patch_statusreporter()

        self.options.setdefault("sources", [])