관리-도구
편집 파일: cover.cpython-37.pyc
B 1�Se�- � @ s^ d Z ddlZddlZddlZddlZddlmZ ddlmZm Z e� e�ZG dd� de�Z dS )a� If you have Ned Batchelder's coverage_ module installed, you may activate a coverage report with the ``--with-coverage`` switch or NOSE_WITH_COVERAGE environment variable. The coverage report will cover any python source module imported after the start of the test run, excluding modules that match testMatch. If you want to include those modules too, use the ``--cover-tests`` switch, or set the NOSE_COVER_TESTS environment variable to a true value. To restrict the coverage report to modules from a particular package or packages, use the ``--cover-package`` switch or the NOSE_COVER_PACKAGE environment variable. .. _coverage: http://www.nedbatchelder.com/code/modules/coverage.html � N)�Plugin)�src�tolistc sr e Zd ZdZdZdZdZdZdZdZ i Z � fdd�Z� fdd�Zd d � Z dd� Zd d� Zdd� Zddd�Z� ZS )�CoveragezL Activate a coverage report using Ned Batchelder's coverage module. FN�� c s$ t t| ��||� |jdd|�d�dddd� |jdd |�d �ddd � |jdd d|�d�dd� |jddd|�d�dd� |jdd d|�d�dd� |jdd |�d�ddd � |jd d|�d!d"�d#d$d%d&� |jd'd |�d(�d)d*d � |jd+d |�d,�d-d.d � |jd/d|�d0d1�d2d3d4d&� d5S )6z. Add options to command line. z--cover-package�appendZNOSE_COVER_PACKAGEZPACKAGE�cover_packageszBRestrict coverage output to selected packages [NOSE_COVER_PACKAGE])�action�default�metavar�dest�helpz --cover-erase� store_trueZNOSE_COVER_ERASE�cover_erasez9Erase previously collected coverage statistics before run)r r r r z --cover-tests�cover_testsZNOSE_COVER_TESTSz:Include test modules in coverage report [NOSE_COVER_TESTS])r r r r z--cover-min-percentage�store�cover_min_percentageZNOSE_COVER_MIN_PERCENTAGEzLMinimum percentage of coverage for tests to pass [NOSE_COVER_MIN_PERCENTAGE]z--cover-inclusive�cover_inclusiveZNOSE_COVER_INCLUSIVEz�Include all python files under working directory in coverage report. Useful for discovering holes in test coverage if not all files are imported by the test suite. [NOSE_COVER_INCLUSIVE]z--cover-htmlZNOSE_COVER_HTML� cover_htmlz!Produce HTML coverage informationz--cover-html-dirZNOSE_COVER_HTML_DIRZcover�cover_html_dirZDIRz(Produce HTML coverage information in dir)r r r r r z--cover-branchesZNOSE_COVER_BRANCHES�cover_branchesz@Include branch coverage in coverage report [NOSE_COVER_BRANCHES]z--cover-xmlZNOSE_COVER_XML� cover_xmlz Produce XML coverage informationz--cover-xml-fileZNOSE_COVER_XML_FILEzcoverage.xml�cover_xml_fileZFILEz(Produce XML coverage information in fileN)�superr �options� add_option�get)�self�parser�env)� __class__� �C/opt/alt/python37/lib/python3.7/site-packages/nose/plugins/cover.pyr # sX zCoverage.optionsc s$ y| j �d� W n tk r$ Y nX tt| ��||� | jr�yddl}t|d�sZt d��W n$ t k r� t �d� d| _dS X || _|j | _|j| _g | _|jr�t|jttf�r�|j}n|jg}x"dd � |D �D ]}| j�|� q�W |j| _| j�rt �d | j� d| _|j�r*|j| _t �d| j� |j| _d| _ |j!�rRt"|j!�#d��| _$|j%�rp|j&| _ t �d | j � | j�r d| j d<