def read_nose(in_file):
        """ Parse nose-style test reports into a `dict`

        Args:
            in_file (:obj:`str`): path to nose-style test report

        Returns:
            :obj:`dict`: dictionary of test suites
        """
        suites = {}
        doc_xml = minidom.parse(in_file)
        suite_xml = doc_xml.getElementsByTagName("testsuite")[0]
        for case_xml in suite_xml.getElementsByTagName('testcase'):
            classname = case_xml.getAttribute('classname')
            if classname not in suites:
                suites[classname] = []
            case = {
                'name': case_xml.getAttribute('name'),
                'time': float(case_xml.getAttribute('time')),
            }
            
            skipped_xml = case_xml.getElementsByTagName('skipped')
            if skipped_xml:
                if skipped_xml[0].hasAttribute('type'):
                    type = skipped_xml[0].getAttribute('type')
                else:
                    type = ''
                case['skipped'] = {
                    'type': type,
                    'message': skipped_xml[0].getAttribute('message'),
                    'text': "".join([child.nodeValue for child in skipped_xml[0].childNodes]),
                }

            failure_xml = case_xml.getElementsByTagName('failure')
            if failure_xml:
                if failure_xml[0].hasAttribute('type'):
                    type = failure_xml[0].getAttribute('type')
                else:
                    type = ''
                case['failure'] = {
                    'type': type,
                    'message': failure_xml[0].getAttribute('message'),
                    'text': "".join([child.nodeValue for child in failure_xml[0].childNodes]),
                }

            error_xml = case_xml.getElementsByTagName('error')
            if error_xml:
                if error_xml[0].hasAttribute('type'):
                    type = error_xml[0].getAttribute('type')
                else:
                    type = ''
                case['error'] = {
                    'type': type,
                    'message': error_xml[0].getAttribute('message'),
                    'text': "".join([child.nodeValue for child in error_xml[0].childNodes]),
                }

            suites[classname].append(case)

        return suites
def read_nose ( in_file ) : suites = { } doc_xml = minidom . parse ( in_file ) suite_xml = doc_xml . getElementsByTagName ( "testsuite" ) [ 0 ] for case_xml in suite_xml . getElementsByTagName ( 'testcase' ) : classname = case_xml . getAttribute ( 'classname' ) if classname not in suites : suites [ classname ] = [ ] case = { 'name' : case_xml . getAttribute ( 'name' ) , 'time' : float ( case_xml . getAttribute ( 'time' ) ) , } skipped_xml = case_xml . getElementsByTagName ( 'skipped' ) if skipped_xml : if skipped_xml [ 0 ] . hasAttribute ( 'type' ) : type = skipped_xml [ 0 ] . getAttribute ( 'type' ) else : type = '' case [ 'skipped' ] = { 'type' : type , 'message' : skipped_xml [ 0 ] . getAttribute ( 'message' ) , 'text' : "" . join ( [ child . nodeValue for child in skipped_xml [ 0 ] . childNodes ] ) , } failure_xml = case_xml . getElementsByTagName ( 'failure' ) if failure_xml : if failure_xml [ 0 ] . hasAttribute ( 'type' ) : type = failure_xml [ 0 ] . getAttribute ( 'type' ) else : type = '' case [ 'failure' ] = { 'type' : type , 'message' : failure_xml [ 0 ] . getAttribute ( 'message' ) , 'text' : "" . join ( [ child . nodeValue for child in failure_xml [ 0 ] . childNodes ] ) , } error_xml = case_xml . getElementsByTagName ( 'error' ) if error_xml : if error_xml [ 0 ] . hasAttribute ( 'type' ) : type = error_xml [ 0 ] . getAttribute ( 'type' ) else : type = '' case [ 'error' ] = { 'type' : type , 'message' : error_xml [ 0 ] . getAttribute ( 'message' ) , 'text' : "" . join ( [ child . nodeValue for child in error_xml [ 0 ] . childNodes ] ) , } suites [ classname ] . append ( case ) return suites
Parse nose-style test reports into a `dict`

        Args:
            in_file (:obj:`str`): path to nose-style test report

        Returns:
            :obj:`dict`: dictionary of test suites