How to use the junitparser.junitparser.TestSuite function in junitparser

To help you get started, we’ve selected a few junitparser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def __iter__(self):
        return super(JUnitXml, self).iterchildren(TestSuite)
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def __get__(self, instance, cls):
        result = super(IntAttr, self).__get__(instance, cls)
        if result is None and (
            isinstance(instance, JUnitXml) or isinstance(instance, TestSuite)
        ):
            instance.update_statistics()
            result = super(IntAttr, self).__get__(instance, cls)
        return int(result) if result else None
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def __get__(self, instance, cls):
        result = super(FloatAttr, self).__get__(instance, cls)
        if result is None and (
            isinstance(instance, JUnitXml) or isinstance(instance, TestSuite)
        ):
            instance.update_statistics()
            result = super(FloatAttr, self).__get__(instance, cls)
        return float(result) if result else None
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def __iter__(self):
        return super(JUnitXml, self).iterchildren(TestSuite)
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def __iadd__(self, other):
        if other._elem.tag == "testsuites":
            for suite in other:
                self.add_testsuite(suite)
        elif other._elem.tag == "testsuite":
            suite = TestSuite(name=other.name)
            for case in other:
                suite._add_testcase_no_update_stats(case)
            self.add_testsuite(suite)
            self.update_statistics()

        return self
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def remove_testcase(self, testcase):
        """Removes a test case from the suite."""
        for case in self:
            if case == testcase:
                super(TestSuite, self).remove(case)
                self.update_statistics()
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def fromfile(cls, filepath):
        """Initiate the object from a report file."""
        tree = etree.parse(filepath)
        root_elem = tree.getroot()
        if root_elem.tag == "testsuites":
            instance = cls()
        elif root_elem.tag == "testsuite":
            instance = TestSuite()
        else:
            raise JUnitXmlError("Invalid format.")
        instance._elem = root_elem
        instance.filepath = filepath
        return instance
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def fromfile(cls, filepath):
        """Initiate the object from a report file."""
        tree = etree.parse(filepath)
        root_elem = tree.getroot()
        if root_elem.tag == "testsuites":
            instance = cls()
        elif root_elem.tag == "testsuite":
            instance = TestSuite()
        else:
            raise JUnitXmlError("Invalid format.")
        instance._elem = root_elem
        instance.filepath = filepath
        return instance
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def __iadd__(self, other):
        if other._elem.tag == "testsuites":
            for suite in other:
                self.add_testsuite(suite)
        elif other._elem.tag == "testsuite":
            suite = TestSuite(name=other.name)
            for case in other:
                suite._add_testcase_no_update_stats(case)
            self.add_testsuite(suite)
            self.update_statistics()

        return self
github gastlygem / junitparser / junitparser / junitparser.py View on Github external
def remove_testcase(self, testcase):
        """Removes a test case from the suite."""
        for case in self:
            if case == testcase:
                super(TestSuite, self).remove(case)
                self.update_statistics()