o
    %ifV                     @   sd   d dl Z d dlmZ d dlZdd Zdd ZG dd deZe d	d
 Z	ej
dddd ZdS )    N)TestCasec                 C   s.   | j dddtdd | j dddtdd	d
 d S )Nz--countstore   z#Number of times to repeat each test)actiondefaulttypehelpz--repeat-scopefunction)r	   classmodulesessionzScope for repeating tests)r   r   r   choicesr   )	addoptionintstr)parser r   F/var/www/html/corbot_env/lib/python3.10/site-packages/pytest_repeat.pypytest_addoption
   s   
r   c                 C   s   |  dd d S )Nmarkersz1repeat(n): run the given test function `n` times.)addinivalue_line)configr   r   r   pytest_configure   s   r   c                   @   s   e Zd ZdS )UnexpectedErrorN)__name__
__module____qualname__r   r   r   r   r   !   s    r   c                 C   sl   | j d}|r|jd p| jjj}|dkr4z| jW S  ty3   t| j	t
r/td Y d S tdw d S )Nrepeatr   r   z,Repeating unittest class tests not supportedz]This call couldn't work with pytest-repeat. Please consider raising an issue with your usage.)nodeget_closest_markerargsr   optioncountparamAttributeError
issubclassclsr   warningswarnr   )requestmarkerr"   r   r   r   __pytest_repeat_step_number%   s   
r+   T)trylastc                 C   sv   | j jj}| jd}|d urt|jd }|dkr9| jd |fdd}| j jj	}| j
dt|d||d d S d S )	Nr   r   r   r+   c                 S   s   d | d |S )Nz{0}-{1}r   )format)inr   r   r   make_progress_id?   s   z/pytest_generate_tests.<locals>.make_progress_idT)indirectidsscope)r   r!   r"   
definitionr   r   r    fixturenamesappendrepeat_scopeparametrizerange)metafuncr"   mr0   r3   r   r   r   pytest_generate_tests6   s    


r<   )r'   unittestr   pytestr   r   	Exceptionr   fixturer+   hookimplr<   r   r   r   r   <module>   s   

