
    9[g
                        d Z ddlmZ ddlmZ ddlmZ ddlmZ ed   Z	e G d de             Z
 ee
      Z ee      D  ci c]  \  } }|| 
 c}} Ze
D cg c]  }|e
j                  us| c}Zy	c c}} w c c}w )
a"  
Scope definition and related utilities.

Those are defined here, instead of in the 'fixtures' module because
their use is spread across many other pytest modules, and centralizing it in 'fixtures'
would cause circular references.

Also this makes the module light to import, as it should.
    )annotations)Enum)total_ordering)Literal)sessionpackagemoduleclassfunctionc                      e Zd ZU dZdZded<   dZded<   dZded<   d	Zded
<   dZ	ded<   ddZ
ddZddZe	 d	 	 	 	 	 	 	 dd       Zy)Scopez
    Represents one of the possible fixture scopes in pytest.

    Scopes are ordered from lower to higher, that is:

              ->>> higher ->>>

    Function < Class < Module < Package < Session

              <<<- lower  <<<-
    r   
_ScopeNameFunctionr
   Classr	   Moduler   Packager   Sessionc                R    t         |    }|dk(  rt        |  d      t        |dz
     S )zReturn the next lower scope.r   z is the lower-most scope   )_SCOPE_INDICES
ValueError_ALL_SCOPESselfindexs     H/var/www/html/bid-api/venv/lib/python3.12/site-packages/_pytest/scope.py
next_lowerzScope.next_lower*   s5    t$A:v%=>??519%%    c                r    t         |    }|t        t               dz
  k(  rt        |  d      t        |dz      S )zReturn the next higher scope.r   z is the upper-most scope)r   lenr   r   r   s     r   next_higherzScope.next_higher1   s@    t$C'!++v%=>??519%%r   c                0    t         |    }t         |   }||k  S N)r   )r   other
self_indexother_indexs       r   __lt__zScope.__lt__8   s!    #D)
$U+K''r   Nc           	         ddl m} 	 t        |      }|S # t        $ r'  |dj	                  ||rd| dnd|      d       Y S w xY w)	a  
        Given a scope name from the user, return the equivalent Scope enum. Should be used
        whenever we want to convert a user provided scope name to its enum object.

        If the scope name is invalid, construct a user friendly message and call pytest.fail.
        r   )failz'{} {}got an unexpected scope value '{}'zfrom   F)pytrace)_pytest.outcomesr)   r   r   format)cls
scope_namedescrwherer)   scopes         r   	from_userzScope.from_user=   sd     	*		*%E   	9@@uU5'+"j 	 	s    ,AA)returnr   )r$   r   r5   boolr#   )r0   r   r1   strr2   z
str | Noner5   r   )__name__
__module____qualname____doc__r   __annotations__r   r   r   r   r   r!   r'   classmethodr4    r   r   r   r      s    
 &Hj%E:!FJ!#GZ##GZ#&&(
 EI#,/8B	 r   r   N)r;   
__future__r   enumr   	functoolsr   typingr   r   r   listr   	enumerater   r   HIGH_SCOPES)r   r3   xs   000r   <module>rG      s    #  $  HI
 =D = =@ 5k3<[3IJ3I<5%%,3IJ  ;%Q1ENN#:q%;	 K <s   A4A:,A: