관리-도구
편집 파일: xunit.cpython-311.pyc
� �܋f � �: � d dl mZ d dlmZ G d� de� � ZdS )� )�Document)� Formatterc � � e Zd ZdZdd�ZdS )�XunitFormatterz� This formatter outputs messages in the Xunit xml format, which is used by several CI tools to parse output. This formatter is therefore a compatibility shim between tools built to use Xunit and prospector itself. TFc �� � t � � }|� d� � }|� dt | j d � � � � |� dd� � |� ddd� | j d � � z � � |� d t | j d � � � � |� dt | j d � � � � |� |� � |� d � � }|� |� � |� d� � }|� |� d� � � � |� |� � |� d� � }|� |� d� � � � |� |� � t | j � � D �]l} |� d� � } | � d| � | j j � � � d| j j � �� � |� d� � }|� d| j � � � � � |� dd| j z � � d}|| � | j j � � | j j | j | j | j j | j � � � d�z } |� |� | � � � � | � |� � |� | � � ��n|� � � S )N� testsuite�errors� message_count�failures�0�namez prospector-%s�-�tools�tests�time� time_taken� propertiesz system-out� z system-err�testcase�error�message�typez%s ErrorzC%(path)s:%(line)s: [%(code)s(%(source)s), %(function)s] %(message)s)�path�line�source�code�functionr )r � createElement�setAttribute�str�summary�join�appendChild�createCDATASection�sorted�messages� _make_path�locationr r r �stripr r r �toprettyxml)�selfr! r&