403Webshell
Server IP : 127.0.0.1  /  Your IP : 216.73.216.109
Web Server : Apache/2.4.54 (Win64) OpenSSL/1.1.1q PHP/8.1.10
System : Windows NT DESKTOP-E5T4RUN 10.0 build 19045 (Windows 10) AMD64
User : SERVERWEB ( 0)
PHP Version : 8.1.10
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : OFF |  Perl : OFF |  Python : OFF |  Sudo : OFF |  Pkexec : OFF
Directory :  C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : C:/cygwin64/lib/python3.9/site-packages/_pytest/__pycache__/nodes.cpython-39.pyc
a

05d�g�@s�ddlZddlZddlmZddlmZddlmZddlmZddlm	Z	ddlm
Z
ddlmZdd	lmZdd
lm
Z
ddlmZddlmZdd
lmZddlmZddlmZddlmZddlmZddlmZddlZddlmZddlmZddlmZddlmZddlmZddlm Z ddlm!Z!ddl"m#Z#ddl"m$Z$ddl%m&Z&ddl%m'Z'ddl%m(Z(ddl)m*Z*dd l+m,Z,dd!l+m-Z-dd"l.m/Z/dd#l0m1Z1e�r�dd$l2m3Z3dd%lm4Z4d&Z5eej6�j7Z8e9ee9d'�d(d)�Z:eedd*�d+d,�Z;ed-eeeeed.�d/d0�Z<ed1d-d2�Z=Gd3d4�d4e>�Z?Gd5d-�d-e?d6�Z@d-eee9efeeAfd7�d8d9�ZBGd:d;�d;e@�ZCd<eee9d=�d>d?�ZDGd@dA�dAeC�ZEGdBdC�dCeE�ZFGdDdE�dEe@�ZGdS)F�N)�	signature)�Path)�Any)�Callable)�cast)�Iterable)�Iterator)�List)�MutableMapping)�Optional)�overload)�Set)�Tuple)�Type)�
TYPE_CHECKING)�TypeVar)�Union)�getfslineno)�
ExceptionInfo)�TerminalRepr)�cached_property)�LEGACY_PATH)�Config)�ConftestImportFailure)�#FSCOLLECTOR_GETHOOKPROXY_ISINITPATH)�NODE_CTOR_FSPATH_ARG)�Mark)�
MarkDecorator)�NodeKeywords)�fail)�absolutepath)�
commonpath)�Stash)�
PytestWarning)�Session)�_TracebackStyle�/)�nodeid�returnccs�d}|�d�}|dkrd}dV|�t||�}|dkr8q\|dkrN|d|�V|tt�}q |�d|�}|dkrrq�|dkr�|d|�V|td�}q\|r�|VdS)a�Return the parent node IDs of a given node ID, inclusive.

    For the node ID

        "testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_source"

    the result would be

        ""
        "testing"
        "testing/code"
        "testing/code/test_excinfo.py"
        "testing/code/test_excinfo.py::TestFormattedExcinfo"
        "testing/code/test_excinfo.py::TestFormattedExcinfo::test_repr_source"

    Note that / components are only considered until the first ::.
    r�::���N�)�find�SEP�len)r'�posZfirst_colonsZat�r0�1/usr/lib/python3.9/site-packages/_pytest/nodes.py�iterparentnodeids3s&
r2)�path�fspathr(cCs&t|�|kr"td|�d|�d���dS)NzPath(z) != z8
if both path and fspath are given they need to be equal)r�
ValueError)r3r4r0r0r1�_check_path`s�r6�Node)�	node_typer3r4r(cCsV|dur tjtj|jd�dd�|dur>|dur:t||�|S|dusJJ�t|�SdS)N)Znode_type_name���
stacklevel)�warnings�warnr�format�__name__r6r)r8r3r4r0r0r1�_imply_pathhs��
r@�	_NodeType)�boundcs$eZdZdd�Z�fdd�Z�ZS)�NodeMetacOs*dj|j�d|j��d�}t|dd�dS)Nz�Direct construction of {name} has been deprecated, please use {name}.from_parent.
See https://docs.pytest.org/en/stable/deprecations.html#node-construction-changed-to-node-from-parent for more details.�.��nameF)�pytrace)r>�
__module__r?r)�self�k�kw�msgr0r0r1�__call__�s
��zNodeMeta.__call__c
s�zt�j|i|��WSty�tt|d����fdd�|��D�}ddlm}t�	||�dt
|��d���t�j|i|��YS0dS)N�__init__cs i|]\}}|�jvr||�qSr0)�
parameters)�.0rJ�v�Zsigr0r1�
<dictcomp>��z$NodeMeta._create.<locals>.<dictcomp>�)�PytestDeprecationWarningz7 is not using a cooperative constructor and only takes z�.
See https://docs.pytest.org/en/stable/deprecations.html#constructors-of-custom-pytest-node-subclasses-should-take-kwargs for more details.)�superrM�	TypeErrorr�getattr�itemsZ
warning_typesrVr<r=�set)rIrJrKZknown_kwrV��	__class__rRr1�_create�s��	zNodeMeta._create)r?rH�__qualname__rMr^�
__classcell__r0r0r\r1rC�s	rCc
@seZdZUdZeed<dZd@edee	deeee
eedd�dd	�Zedd
�dd��Z
ed
d��Zed�dd�Zedd�dd�Zeed�dd��Zed�dd�Zdd�dd�Zdd�dd�Zedd�dd�ZdAeeefedd �d!d"�ZdBeeeed#�d$d%�Z dCeeee!defd#�d&d'�Z"e#eeed#�d(d)��Z$e#eeed*�d+d)��Z$dDeeeeed*�d,d)�Z$e%ed�d-d.�Z&eed�d/d0�Z'e(ge)fdd1�d2d3�Z*e+e,ee,d4�d5d6�Z-e.e/dd7�d8d9�Z0dEe.e/d:e1d;�d<d=�Z2dFe.e/d:eee1fd;�d>d?�Z3dS)Gr7z�Base class for Collector and Item, the components of the test
    collection tree.

    Collector subclasses have children; Items are leaf nodes.
    r4)rF�parent�config�sessionr3�_nodeid�_store�__dict__NzOptional[Node]zOptional[Session])rFrarbrcr4r3r'r(cCs�||_||_|r||_n|s$td��|j|_|r8||_n|sDtd��|j|_|durh|durht|dd�}tt|�||d�|_t	|�|_
g|_t�|_
|dur�d|vs�J�||_n"|js�td��|jjd|j|_t�|_|j|_dS)Nz!config or parent must be providedz"session or parent must be providedr3�r4z::()z!nodeid or parent must be providedr))rFrarbrXrcrYr@�typer3r�keywords�own_markersr[�extra_keyword_matchesrdr'r"Zstashre)rIrFrarbrcr4r3r'r0r0r1rN�s4
z
Node.__init__)racKs4d|vrtd��d|vr td��|jfd|i|��S)a:Public constructor for Nodes.

        This indirection got introduced in order to enable removing
        the fragile logic from the node constructors.

        Subclasses can use ``super().from_parent(...)`` when overriding the
        construction.

        :param parent: The parent node of this Node.
        rbz.config is not a valid argument for from_parentrcz/session is not a valid argument for from_parentra)rXr^)�clsrarKr0r0r1�from_parent�s
zNode.from_parentcCs|j�|j�S)z6fspath-sensitive hook proxy used to call pytest hooks.)rc�gethookproxyr3�rIr0r0r1�ihooksz
Node.ihook�r(cCsd�|jjt|dd��S)Nz<{} {}>rF)r>r]r?rYror0r0r1�__repr__
sz
Node.__repr__)�warningr(cCsNt|t�std�|���t|�\}}|dus0J�tj|dt|�|dd�dS)awIssue a warning for this Node.

        Warnings will be displayed after the test session, unless explicitly suppressed.

        :param Warning warning:
            The warning instance to issue.

        :raises ValueError: If ``warning`` instance is not a subclass of Warning.

        Example usage:

        .. code-block:: python

            node.warn(PytestWarning("some message"))
            node.warn(UserWarning("some message"))

        .. versionchanged:: 6.2
            Any subclass of :class:`Warning` is now accepted, rather than only
            :class:`PytestWarning <pytest.PytestWarning>` subclasses.
        z<warning must be an instance of Warning or subclass, got {!r}NrU)�category�filename�lineno)�
isinstance�Warningr5r>�get_fslocation_from_itemr<�
warn_explicit�str)rIrsr3rvr0r0r1r=s
���z	Node.warncCs|jS)z;A ::-separated string denoting its collection tree address.)rdror0r0r1r'7szNode.nodeidcCs
t|j�S�N)�hashrdror0r0r1�__hash__<sz
Node.__hash__cCsdSr|r0ror0r0r1�setup?sz
Node.setupcCsdSr|r0ror0r0r1�teardownBsz
Node.teardowncCs.g}|}|dur"|�|�|j}q|��|S)z�Return list of all parent collectors up to self, starting from
        the root of collection tree.

        :returns: The nodes.
        N)�appendra�reverse)rI�chain�itemr0r0r1�	listchainEs
zNode.listchainT)�markerr�r(cCsnddlm}t|t�r|}nt|t�r2t||�}ntd��||j|j<|rZ|j	�
|j�n|j	�d|j�dS)z�Dynamically add a marker object to the node.

        :param marker:
            The marker.
        :param append:
            Whether to append the marker, or prepend it.
        r)�MARK_GENz'is not a string or pytest.mark.* MarkerN)
Z_pytest.markr�rwrr{rYr5rirFrjr��mark�insert)rIr�r�r�Zmarker_r0r0r1�
add_markerSs


zNode.add_marker)rFr(cCsdd�|j|d�D�S)z�Iterate over all markers of the node.

        :param name: If given, filter the results by the name attribute.
        :returns: An iterator of the markers of the node.
        css|]}|dVqdS)rUNr0�rP�xr0r0r1�	<genexpr>qrTz$Node.iter_markers.<locals>.<genexpr>rE)�iter_markers_with_node�rIrFr0r0r1�iter_markerskszNode.iter_markersccsDt|���D]2}|jD]&}|dus2t|dd�|kr||fVqqdS)z�Iterate over all markers of the node.

        :param name: If given, filter the results by the name attribute.
        :returns: An iterator of (node, mark) tuples.
        NrF)�reversedr�rjrY)rIrF�noder�r0r0r1r�ss
zNode.iter_markers_with_nodecCsdSr|r0r�r0r0r1�get_closest_marker�szNode.get_closest_marker)rF�defaultr(cCsdSr|r0�rIrFr�r0r0r1r��scCst|j|d�|�S)z�Return the first marker matching the name, from closest (for
        example function) to farther level (for example module level).

        :param default: Fallback return value if no marker was found.
        :param name: Name to filter by.
        rE)�nextr�r�r0r0r1r��s	cCs$t�}|��D]}|�|j�q|S)z;Return a set of all extra keywords in self and any parents.)r[r��updaterk)rIZextra_keywordsr�r0r0r1�listextrakeywords�szNode.listextrakeywordscCsdd�|��D�S)NcSsg|]
}|j�qSr0rEr�r0r0r1�
<listcomp>�rTz"Node.listnames.<locals>.<listcomp>)r�ror0r0r1�	listnames�szNode.listnames)�finr(cCs|jj�||�dS)z�Register a function to be called without arguments when this node is
        finalized.

        This method can only be called when this node is active
        in a setup chain, for example during self.setup().
        N)rcZ_setupstate�addfinalizer)rIr�r0r0r1r��szNode.addfinalizer)rlr(cCs4|}|rt||�s|j}q|dus0t||�s0J�|S)z�Get the next parent node (including self) which is an instance of
        the given class.

        :param cls: The node class to search for.
        :returns: The node, if found.
        N)rwra)rIrl�currentr0r0r1�	getparent�s
zNode.getparent��excinfor(cCsdSr|r0)rIr�r0r0r1�_prunetraceback�szNode._prunetracebackzOptional[_TracebackStyle])r��styler(cCs<ddlm}t|jt�r&t�|jj�}t|jtj	�r@|jj
s@d}t|j|�rV|j��S|j�
dd�rjd}n>tj�|jdg�}|�|�t|j�dkr�||_|dkr�d}|dur�|j�
d	d�d
kr�d
}nd}|j�
dd�dkr�d}nd
}ztt���|jjjk}Wnt�yd
}Yn0|jd
||j�
dd�|d|d�S)Nr)�FixtureLookupError�value�	fulltraceFZlongr*�auto�tbstyle�short�verboserUT�
showlocals)Zfuncargs�abspathr�r�Ztbfilter�truncate_locals)Z_pytest.fixturesr�rwr�rrZ
from_exc_infor�r�	ExceptionrGZ
formatreprrb�	getoption�_pytest�_codeZ	Traceback�	tracebackr�r.r�os�getcwdZinvocation_params�dir�OSErrorZgetrepr)rIr�r�r��tbr�r�r0r0r1�_repr_failure_py�sF


�zNode._repr_failure_pycCs|�||�S)z�Return a representation of a collection or test failure.

        .. seealso:: :ref:`non-python tests`

        :param excinfo: Exception information for the failure.
        )r�)rIr�r�r0r0r1�repr_failure�szNode.repr_failure)NNNNNN)T)N)N)N)N)N)4r?rHr_�__doc__r�__annotations__�	__slots__r{rrrrN�classmethodrm�propertyrprrrxr=r'�intr~rr�r	r�rr�boolr�rrr�rr�rr�r
r�r�r�objectr�rrAr�r�
BaseExceptionr�rr�r�r0r0r0r1r7�s�
��=
'��	��
��	
��:�
�)�	metaclass)r�r(cCsLt|dd�}|dur |dd�St|dd�}|dur<t|�St|dd�dfS)aTry to extract the actual location from a node, depending on available attributes:

    * "location": a pair (path, lineno)
    * "obj": a Python object that the node wraps.
    * "fspath": just a path

    :rtype: A tuple of (str|Path, int) with filename and 0-based line number.
    �locationN��objr4zunknown locationr*)rYr)r�r�r�r0r0r1ry�s
ryc@sfeZdZdZGdd�de�Zeedd�dd�Ze	e
eeefd�d	d
�Z
e	e
dd�dd
�ZdS)�	Collectorz\Collector instances create children through collect() and thus
    iteratively build a tree.c@seZdZdZdS)zCollector.CollectErrorz6An error during collection, contains a custom message.N�r?rHr_r�r0r0r0r1�CollectErrorsr�)�Itemr�rqcCstd��dS)zRReturn a list of children (items and collectors) for this
        collection node.ZabstractN��NotImplementedErrorror0r0r1�collectszCollector.collectr�cCsXt|j|j�r0|j�dd�s0|j}t|jd�S|j�dd�}|dkrJd}|j||d�S)zyReturn a representation of a collection failure.

        :param excinfo: Exception information for the failure.
        r�Frr�r�r�)r�)rwr�r�rbr�r{�argsr�)rIr��excr�r0r0r1r�s�zCollector.repr_failureNcCs@t|d�r<|j}|j|jd�}||kr2|jtd�}|��|_dS)Nr3�r3)Zexcludepath)�hasattrr�Zcutr3�tracebackcutdir�filter)rIr�r�Z
ntracebackr0r0r1r�0s
zCollector._prunetraceback)r?rHr_r�r�r�rrr�rr�r{rr�r�r0r0r0r1r�s
�r�r$)rcr3r(cCs@|jD]4}t||�|krt|�|��}|dkr2dn|SqdS)NrDr+)Z
_initialpathsr!r{�relative_to)rcr3Zinitial_path�relr0r0r1�_check_initialpaths_for_relpath9s

r�cs�eZdZdeeeeeefeeeeeeee	edeedd�	�fdd�
Z
eddd�eeeed��fdd��Zd	d
�dd�Z
eed	fed
�dd�Z�ZS)�FSCollectorNr$)	r4�path_or_parentr3rFrarbrcr'r(c	
sJ|r@t|t�r&|dusJ�tt|�}nt|t�r@|dus<J�|}tt|�||d�}|dur�|j}|dur�|j|kr�z|�	|j�}	Wnt
y�Yn
0t|	�}|�t
jt�}||_|dur�|dus�J�|j}|du�r.zt|j�	|jj��}Wnt
�yt||�}Yn0|�r.t
jtk�r.|�t
jt�}t�j||||||d�dS)Nrg)rFrarbrcr'r3)rwr7rr�rr@rhrFr3r�r5r{�replacer��sepr-rcrbZrootpathr�rWrN)
rIr4r�r3rFrarbrcr'r�r\r0r1rNBsH


�zFSCollector.__init__)r4r3cst�jf|||d�|��S)zThe public constructor.)rar4r3)rWrm)rlrar4r3rKr\r0r1rmxs
zFSCollector.from_parent�os.PathLike[str]rgcCstjtdd�|j�|�S�Nr�r:)r<r=rrcrn)rIr4r0r0r1rn�szFSCollector.gethookproxy)r3r(cCstjtdd�|j�|�Sr�)r<r=rrc�
isinitpath)rIr3r0r0r1r��szFSCollector.isinitpath)NNNNNNNN)r?rHr_rrrrr7r{rrNr�rmrnr�r�r`r0r0r\r1r�As8��6��r�c@seZdZdZdS)�FilezOBase class for collecting tests from a file.

    :ref:`non-python tests`.
    Nr�r0r0r0r1r��sr�cs�eZdZdZdZdeeedeedd��fdd�
Zdd�dd	�Z	dd�d
d�Z
eeedd�d
d�Zee
defeeefd�dd�Zeeeeeefd�dd��Z�ZS)r�zvA basic test invocation item.

    Note that for a single function there might be multiple test invocation items.
    Nr$)rbrcr'r(cs6t�j||f|||d�|��g|_g|_|��dS)N)rbrcr')rWrN�_report_sectionsZuser_properties�-_check_item_and_collector_diamond_inheritance)rIrFrarbrcr'rKr\r0r1rN�s
���z
Item.__init__rqcCs`t|�}d}t||d�rdSt||d�d�dd�|jD��}|r\t�|j�d|�d	�t�dS)
z�
        Check if the current type inherits from both File and Collector
        at the same time, emitting a warning accordingly (#8447).
        Z)_pytest_diamond_inheritance_warning_shownFNTz, css|]}t|t�r|jVqdSr|)�
issubclassr�r?)rP�baser0r0r1r��szEItem._check_item_and_collector_diamond_inheritance.<locals>.<genexpr>zF is an Item subclass and should not be a collector, however its bases z� are collectors.
Please split the Collectors and the Item into separate node types.
Pytest Doc example: https://docs.pytest.org/en/latest/example/nonpython.html
example pull request on a plugin: https://github.com/asmeurer/pytest-flakes/pull/40/)	rhrY�setattr�join�	__bases__r<r=r?r#)rIrlZ	attr_nameZproblemsr0r0r1r��s
���z2Item._check_item_and_collector_diamond_inheritancecCstd��dS)z�Run the test case for this item.

        Must be implemented by subclasses.

        .. seealso:: :ref:`non-python tests`
        z,runtest must be implemented by Item subclassNr�ror0r0r1�runtest�szItem.runtest)�when�key�contentr(cCs|r|j�|||f�dS)aAdd a new report section, similar to what's done internally to add
        stdout and stderr captured output::

            item.add_report_section("call", "stdout", "report section contents")

        :param str when:
            One of the possible capture states, ``"setup"``, ``"call"``, ``"teardown"``.
        :param str key:
            Name of the section, can be customized at will. Pytest uses ``"stdout"`` and
            ``"stderr"`` internally.
        :param str content:
            The full contents as a string.
        N)r�r�)rIr�r�r�r0r0r1�add_report_section�szItem.add_report_sectionr�cCs|jddfS)aPGet location information for this item for test reports.

        Returns a tuple with three elements:

        - The path of the test (default ``self.path``)
        - The 0-based line number of the test (default ``None``)
        - A name of the test to be shown (default ``""``)

        .. seealso:: :ref:`non-python tests`
        Nr+r�ror0r0r1�
reportinfo�szItem.reportinfocCsL|��}tt�|d��}|j�|�}t|d�tus:J�||d|dfS)z�
        Returns a tuple of ``(relfspath, lineno, testname)`` for this item
        where ``relfspath`` is file path relative to ``config.rootpath``
        and lineno is a 0-based line number.
        rr�rU)r�r r�r4rcZ_node_location_to_relpathrhr{)rIr�r3Z	relfspathr0r0r1r��s
z
Item.location)NNNN)r?rHr_r�Znextitemrrr{rNr�r�r�rrr�r�rr�r`r0r0r\r1r��s$��	$
r�)Hr�r<�inspectr�pathlibr�typingrrrrrr	r
rrr
rrrrrZ
_pytest._coder�rZ_pytest._code.coderrZ_pytest.compatrrZ_pytest.configrrZ_pytest.deprecatedrrZ_pytest.mark.structuresrrrZ_pytest.outcomesrZ_pytest.pathlibr r!Z
_pytest.stashr"Z_pytest.warning_typesr#Z_pytest.mainr$r%r-�__file__rar�r{r2r6r@rArhrCr7r�ryr�r�r�r�r�r0r0r0r1�<module>sv-	�_$+L

Youez - 2016 - github.com/yon3zu
LinuXploit