관리-도구
편집 파일: hookspec.cpython-311.pyc
� �܋f. � �� � d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z dd lm Z dd lmZ ddlmZ ddl mZ dd lmZ er�ddlZddlZddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddl"m#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.m0Z0 dd#l1m2Z2 dd$l3m4Z4 dd%l3m5Z5 dd&l6m7Z7 ed'� � Z8 e8d(�)� � d�d-�� � Z9 e8d(�)� � d�d1�� � Z: e8d(�)� � d�d4�� � Z; e8d(�)� � d�d7�� � Z< e8d(�8� � d*d+d9ee= d,ed6 fd:�� � Z> e8e�;� � d5d6d9ee= d,dfd<�� � Z? e8d(�8� � d5d6d,eed=e@f fd>�� � ZAd?d6d2d3d9ee= d,dfd@�ZB e8d(�8� � dAdBd,eeC fdC�� � ZDdAdBd5d6dDedE d,dfdF�ZEd�dG�ZF e8d(�8� � dHedIdJd5d6d,eeG fdK�� � ZHdLedIdJdMdNd,dOfdP�ZId�dR�ZJd�dT�ZKd�dW�ZLdDe dE d,dfdX�ZM e8d(�8� � d�dZ�� � ZN e8d(�8� � d[edIdJd,ed\ fd]�� � ZO e8d(�8� � dQed^ d_e=d`eCd,eddEdNeeda f fdb�� � ZP e8d(�8� � dcddd,eeC fde�� � ZQd�dh�ZR e8d(�8� � d5d6dieCdje=d,ee= fdk�� � ZS e8d(�8� � dAdBd,eeC fdl�� � ZT e8d(�8� � dSdEdmdnd,eeC fdo�� � ZUdpe=dqe e=ee@ e=f d,dfdr�ZVdpe=dqe e=ee@ e=f d,dfds�ZWd�dt�ZXd�du�ZYdSdEdmedE d,dfdv�ZZ e8d(�8� � dSdEdwdxd,edy fdz�� � Z[d�d{�Z\ e8d(�8� � d5d6dUed| d,eee=ef fd}�� � Z] e8d(�8� � d5d6d~ee=ef d,eed| fd�� � Z^ e8d(�8� � d�d�d�d�d,eeC fd��� � Z_ d�d��Z`d�d��ZadAdBd�ee@d=f d,dfd��Zbd�d��Zcd5d6d�e=d�eCd�eCd,eee= f d��ZddSdEd�e@d�e=d�e=d,df d��Zed5d6d�ed�dJd,ee=ee= f fd��Zfd5d6d�ed�dJdDe dE d,ee=ee= f f d��Zg e8d(�8� � dUed| d5d6d,d�fd��� � Zh d�d��Zi e8d(�)� � d�d�d�d�dpe=dqee e=e@e=f d,df d��� � Zjd5d6d,ee=ef fd��Zkd�d�d�d�d,eeG fd��Zl d�d��Zmd�eda dwd�dUed| d,dfd��Znd�d��Zod�d��ZpdS )�zaHook specifications for pytest plugins which are invoked by pytest itself and by builtin plugins.� )�Path)�Any)�Dict)�List)�Mapping)�Optional)�Sequence)�Tuple)� TYPE_CHECKING)�Union)�HookspecMarker)�WARNING_CMDLINE_PREPARSE_HOOKN)�Literal)� ExceptionRepr)� ExceptionInfo)�Config)�ExitCode)�PytestPluginManager)� _PluggyPlugin)�Parser)� FixtureDef)� SubRequest)�Session)� Collector)�Item)�Exit)�Class)�Function)�Metafunc)�Module)� CollectReport)� TestReport)�CallInfo)�TerminalReporter)�TestShortLogReport)�LEGACY_PATH�pytestT)�historic� pluginmanagerr �returnc � � dS )a* Called at plugin registration time to allow adding new hooks via a call to ``pluginmanager.add_hookspecs(module_or_class, prefix)``. :param pytest.PytestPluginManager pluginmanager: The pytest plugin manager. .. note:: This hook is incompatible with ``hookwrapper=True``. N� )r) s �a/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/_pytest/hookspec.py�pytest_addhooksr. 7 � � � � � �pluginr �managerc � � dS )z�A new pytest plugin got registered. :param plugin: The plugin module or instance. :param pytest.PytestPluginManager manager: pytest plugin manager. .. note:: This hook is incompatible with ``hookwrapper=True``. Nr, )r1 r2 s r- �pytest_plugin_registeredr4 C r/ r0 �parserr c � � dS )a� Register argparse-style options and ini-style config values, called once at the beginning of a test run. .. note:: This function should be implemented only in plugins or ``conftest.py`` files situated at the tests root directory due to how pytest :ref:`discovers plugins during startup <pluginorder>`. :param pytest.Parser parser: To add command line options, call :py:func:`parser.addoption(...) <pytest.Parser.addoption>`. To add ini-file values call :py:func:`parser.addini(...) <pytest.Parser.addini>`. :param pytest.PytestPluginManager pluginmanager: The pytest plugin manager, which can be used to install :py:func:`hookspec`'s or :py:func:`hookimpl`'s and allow one plugin to call another plugin's hooks to change how command line options are added. Options can later be accessed through the :py:class:`config <pytest.Config>` object, respectively: - :py:func:`config.getoption(name) <pytest.Config.getoption>` to retrieve the value of a command line option. - :py:func:`config.getini(name) <pytest.Config.getini>` to retrieve a value read from an ini-style file. The config object is passed around on many internal objects via the ``.config`` attribute or can be retrieved as the ``pytestconfig`` fixture. .. note:: This hook is incompatible with ``hookwrapper=True``. Nr, )r5 r) s r- �pytest_addoptionr7 Q r/ r0 �configr c � � dS )a� Allow plugins and conftest files to perform initial configuration. This hook is called for every plugin and initial conftest file after command line options have been parsed. After that, the hook is called for other conftest files as they are imported. .. note:: This hook is incompatible with ``hookwrapper=True``. :param pytest.Config config: The pytest config object. Nr, �r8 s r- �pytest_configurer; x r/ r0 )�firstresult�argsc � � dS )a� Return an initialized :class:`~pytest.Config`, parsing the specified args. Stops at first non-None result, see :ref:`firstresult`. .. note:: This hook will only be called for plugin classes passed to the ``plugins`` arg when using `pytest.main`_ to perform an in-process test run. :param pluginmanager: The pytest plugin manager. :param args: List of arguments passed on the command line. :returns: A pytest config object. Nr, )r) r= s r- �pytest_cmdline_parser? � r/ r0 )�warn_on_implc � � dS )a� (**Deprecated**) modify command line arguments before option parsing. This hook is considered deprecated and will be removed in a future pytest version. Consider using :hook:`pytest_load_initial_conftests` instead. .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. :param config: The pytest config object. :param args: Arguments passed on the command line. Nr, )r8 r= s r- �pytest_cmdline_preparserB � r/ r0 r c � � dS )a Called for performing the main command line action. The default implementation will invoke the configure hooks and runtest_mainloop. Stops at first non-None result, see :ref:`firstresult`. :param config: The pytest config object. :returns: The exit code. Nr, r: s r- �pytest_cmdline_mainrD � r/ r0 �early_configc � � dS )ao Called to implement the loading of initial conftest files ahead of command line option parsing. .. note:: This hook will not be called for ``conftest.py`` files, only for setuptools plugins. :param early_config: The pytest config object. :param args: Arguments passed on the command line. :param parser: To add command line options. Nr, )rE r5 r= s r- �pytest_load_initial_conftestsrG � r/ r0 �sessionr c � � dS )a Perform the collection phase for the given session. Stops at first non-None result, see :ref:`firstresult`. The return value is not used, but only stops further processing. The default collection phase is this (see individual hooks for full details): 1. Starting from ``session`` as the initial collector: 1. ``pytest_collectstart(collector)`` 2. ``report = pytest_make_collect_report(collector)`` 3. ``pytest_exception_interact(collector, call, report)`` if an interactive exception occurred 4. For each collected node: 1. If an item, ``pytest_itemcollected(item)`` 2. If a collector, recurse into it. 5. ``pytest_collectreport(report)`` 2. ``pytest_collection_modifyitems(session, config, items)`` 1. ``pytest_deselected(items)`` for any deselected items (may be called multiple times) 3. ``pytest_collection_finish(session)`` 4. Set ``session.items`` to the list of collected items 5. Set ``session.testscollected`` to the number of collected items You can implement this hook to only perform some action before collection, for example the terminal plugin uses it to start displaying the collection counter (and returns `None`). :param session: The pytest session object. Nr, �rH s r- �pytest_collectionrK � r/ r0 �itemsr c � � dS )z�Called after collection has been performed. May filter or re-order the items in-place. :param session: The pytest session object. :param config: The pytest config object. :param items: List of item objects. Nr, )rH r8 rL s r- �pytest_collection_modifyitemsrN � r/ r0 c � � dS )zmCalled after collection has been performed and modified. :param session: The pytest session object. Nr, rJ s r- �pytest_collection_finishrP r/ r0 �collection_path�pathr&