o
    i.                     @   s>   d Z ddlmZ ddlmZ dd Zdd ZG dd dZd	S )
a  
Hooks for ddtrace pytest features that are not directly related to Test Optimization (such as IAST).

This module is not installed as a pytest entry point, because we want to have a single entry point for ddtrace that can
be easily disabled by invoking pytest with `-p no:ddtrace`. As such, the functions in this file are call explicitly from
`ddtrace/testing/internal/pytest/plugin.py`.
    )configc                 C   s"   |  d}|jdddddd dS )	zAdd ddtrace options.ddtracez--ddtrace-iast-fail-tests
store_truezddtrace-iast-fail-testsFz<If IAST is enabled, fail tests with detected vulnerabilities)actiondestdefaulthelpN)getgroup	addoption)parsergroup r   d/home/ubuntu/.local/lib/python3.10/site-packages/ddtrace/testing/internal/tracer_api/pytest_hooks.pypytest_addoption   s   

r   c                 C   s<   dt _tjrddlm} ddlm} |  | j	t
  d S )NFr   )ddtrace_iast)_iast_pytest_activation)telemetry_configDEPENDENCY_COLLECTION
asm_config_iast_enabled#ddtrace.appsec._iast._pytest_pluginr   ddtrace.appsec._iastr   pluginmanagerregisterDDTracePytestHooks)r   r   r   r   r   r   pytest_configure   s   r   c                   @   s   e Zd Zdd ZdS )r   c                 C   s"   t jrddlm} || d S d S )Nr   )print_iast_report)r   r   r   r   )selfterminalreporterr   r   r   r   pytest_terminal_summary*   s   z*DDTracePytestHooks.pytest_terminal_summaryN)__name__
__module____qualname__r   r   r   r   r   r   )   s    r   N)	__doc__$ddtrace.internal.settings._telemetryr   r   ddtrace.internal.settings.asmr   r   r   r   r   r   r   r   <module>   s    