403Webshell
Server IP : 192.158.238.246  /  Your IP : 18.221.83.23
Web Server : LiteSpeed
System : Linux uniform.iwebfusion.net 4.18.0-553.27.1.lve.1.el8.x86_64 #1 SMP Wed Nov 20 15:58:00 UTC 2024 x86_64
User : jenniferflocom ( 1321)
PHP Version : 8.1.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/alt/python37/lib/python3.7/site-packages/nose/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/alt/python37/lib/python3.7/site-packages/nose/plugins/__pycache__/cover.cpython-37.pyc
B

1�Se�-�@s^dZddlZddlZddlZddlZddlmZddlmZm	Z	e�
e�ZGdd�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�tolistcsreZdZdZdZdZdZdZdZdZ	iZ
�fdd�Z�fdd�Zd	d
�Z
dd�Zd
d�Zdd�Zddd�Z�ZS)�CoveragezL
    Activate a coverage report using Ned Batchelder's coverage module.
    FN��cs$tt|��||�|jdd|�d�dddd�|jdd	|�d
�ddd
�|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rr
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_FILEzcoverage.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.optionscs$y|j�d�Wntk
r$YnXtt|��||�|jr�yddl}t|d�sZt	d��Wn$t	k
r�t
�d�d|_dSX||_|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|jd<|jd|j|j'|jd�|_(d|j(_)|j'|j(_*|j(�+d�t
�d�tt,j-�.��dd�|_/|j�rt
�d�|j(�0�|j(�1�|j(j*�s |j(�2�|j(�3�dS)z#
        Configure plugin.
        ZactiverN�coveragez Unable to import coverage modulez8Coverage not available: unable to import coverage moduleFcSsg|]}t|��qSr!)r)�.0�xr!r!r"�
<listcomp>ysz&Coverage.configure.<locals>.<listcomp>z.Coverage report will include only packages: %sz#Will put HTML coverage report in %s�%z"Will put XML coverage report in %sT)Z	auto_data�branchZdata_suffix�sourcez)#pragma[: ]+[nN][oO] [cC][oO][vV][eE][rR]zCoverage beginz1Clearing previously collected coverage statistics)4�status�pop�KeyErrorrr�	configure�enabledr#�hasattr�ImportError�log�error�confr�
coverEraser�
coverTests�
coverPackagesr�
isinstance�list�tuple�extendr�coverInclusive�info�coverHtmlDirrr�debugrZ
coverBranches�coverXmlFiler�int�rstrip�coverMinPercentagerrZworker�
coverInstanceZ
_warn_no_data�	is_worker�exclude�sys�modules�keys�skipModules�combineZerase�load�start)rrr3r#r�pkgs)r r!r"r-]sp









zCoverage.configurecOs |jjr|j��|j��dS)z7
        Begin recording coverage information.
        N)rCrDrKrL)r�args�kwargsr!r!r"�
beforeTest�s
zCoverage.beforeTestcOs |jjr|j��|j��dS)z6
        Stop recording coverage information.
        N)rCrD�stop�save)rrNrOr!r!r"�	afterTest�s
zCoverage.afterTestc

s�t�d��j���j���j���fdd�ttj�	��D�}t�d|��jj
||d�ddl}�jr�t�d�y�j�
|�j�Wn8|jjk
r�}zt�d	t|��Wdd}~XYnX�j�r(t�d
�y�j�|�j�Wn:|jjk
�r&}zt�dt|��Wdd}~XYnX�j�r�t��}�jj
||d�d}d
}t�||���}|dk�rzt�||���}|�r�t|��d�}	|	�jk�r�t�d�j�t�d�n
t�d�dS)z.
        Output code coverage report.
        zCoverage reportcs g|]\}}��||�r|�qSr!)�wantModuleCoverage)r$�name�module)rr!r"r&�sz#Coverage.report.<locals>.<listcomp>z&Coverage report will cover modules: %s)�filerNzGenerating HTML coverage reportz"Failed to generate HTML report: %szGenerating XML coverage reportz!Failed to generate XML report: %sz@-------\s\w+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?\s+(\d+)%\s+\d*\s{0,1}$zM-------\s[\w./]+\s+\d+\s+\d+(?:\s+\d+\s+\d+)?\s+(\d+)%(?:\s+[-\d, ]+)\s{0,1}$z3TOTAL Coverage did not reach minimum required: %d%%�zGNo total percentage was found in coverage output, something went wrong.)r1r>rCrQrJrRr8rFrG�items�reportr#r=Zhtml_reportZmiscZCoverageException�warning�strr?Z
xml_reportrB�io�StringIO�re�search�getvaluer@�groupsr2�exit)
r�streamrGr#�e�fZmultiPackageReZsinglePackageRe�mZ
percentager!)rr"rZ�sH





$
$

zCoverage.reportcCs�t|d�st�d|�dSt|j�}|r2|�d�sBt�d|�dS|jr�xH|jD]>}t�dt�	|�|�rP|j
s~|jj�
|�sPt�d|�dSqPW||jkr�t�d	|�dS|jj�
|�r�|j
s�t�d
|�dS|jS)N�__file__zno coverage of %s: no __file__Fz.pyz$no coverage of %s: not a python filez^%s\bzcoverage for %sTz0no coverage for %s: loaded before coverage startzno coverage for %s: is a test)r/r1r>rrh�endswithr6r_�findall�escaper5r3Z	testMatchr`rI)rrUrV�module_file�packager!r!r"rT�s,


zCoverage.wantModuleCoveragecCsB|jr>|�d�r>|r:|jr:x"|jD]}|�|�r"dSq"WndSdS)zdIf inclusive coverage enabled, return true for all source files
        in wanted packages.
        z.pyTN)r;rir6�
startswith)rrWrmZwantr!r!r"�wantFiles



zCoverage.wantFile)N)�__name__�
__module__�__qualname__�__doc__r5r6rCr4rB�scorer*rr-rPrSrZrTro�
__classcell__r!r!)r r"rs:B	
6r)rs�loggingr_rFr]Znose.plugins.baserZ	nose.utilrr�	getLoggerrpr1rr!r!r!r"�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit