§
    +P„j  ã                  óö   — d Z ddlmZ ddlZddlZddlmZmZ ddlZdZ	ej
                             e	d¬¦  «        Zdaej         G d„ d	¦  «        ¦   «         Zej        dd„¦   «         Zej        dd„¦   «         ZdS )zPytest utils.é    )ÚannotationsN)ÚAnyÚIteratorFzNon-hermetic test skipped.)Úreasonc                  óJ   — e Zd ZU dZded<    ej        e¬¦  «        Zded<   dS )Ú_SubtestContextz²Context of a test using `subtests` fixture.

  Attributes:
    subtests: Reference to the original `subtests` fixture output
    names: Stack of current nested `subtests.test`
  r   Úsubtests)Údefault_factoryz	list[str]ÚnamesN)	Ú__name__Ú
__module__Ú__qualname__Ú__doc__Ú__annotations__ÚdataclassesÚfieldÚlistr   © ó    úV/root/disk_3tb/conda_envs/Huy-visual/lib/python3.11/site-packages/etils/epy/testing.pyr   r   *   sH   € € € € € € ðð ð €-€-�-Ø&�[Ô&°tÐ<Ñ<Ô<€%Ð<Ð<Ð<Ñ<Ð<Ð<r   r   ÚnameÚstrÚreturnúIterator[None]c              #  óì  K  — t           st          d¦  «        ‚t          | ¦  «        } t           j                             | ¦  «         d                     t           j        ¦  «        }	 t           j                             |¬¦  «        5  dV — ddd¦  «         n# 1 swxY w Y   t           j                             ¦   «         }|| k    sJ ‚dS # t           j                             ¦   «         }|| k    sJ ‚w xY w)zFContextmanager for a new subtest. To use with `with_subtests` fixture.zJ`epy.testing.subtest` can only be called inside a `with_subtests` context.ú/)ÚmsgN)	Ú_curr_contextÚAssertionErrorr   r   ÚappendÚjoinr	   ÚtestÚpop)r   Úsubtest_nameÚout_names      r   Úsubtestr&   7   s=  è è € õ 
ð Ý
ð	#ñô ð õ 
ˆT‰Œ€$ÝÔ×Ò˜TÑ"Ô"Ð"Ø—’�-Ô-Ñ.Ô.€,ðÝ	Ô	×	$Ò	$¨Ð	$Ñ	6Ô	6ð ð Ø€e€e€eðð ð ñ ô ð ð ð ð ð ð øøøð ð ð ð õ Ô"×&Ò&Ñ(Ô(€HØ�tÒÐÐÐÐÐøõ Ô"×&Ò&Ñ(Ô(€HØ�tÒÐÐÐÐÐÐÐs0   Á' C ÂBÂC ÂBÂC ÂBÂ C Ã(C3c              #  óv   K  — t           �t          d¦  «        ‚t          | ¬¦  «        }	 |a dV — da dS # da w xY w)af  Fixture which activate subtests for global usage.

  This fixture is a small wrapper around `subtests` pytest extension fixing
  2 issues:

  * Global usage: https://github.com/pytest-dev/pytest-subtests/issues/44
  * Nested report: https://github.com/pytest-dev/pytest-subtests/issues/45

  Usage:

  ```python
  with_subtests = epy.testing.with_subtests  # Required to register the fixture

  @pytest.mark.usefixtures('with_subtests')
  def my_test():
    with epy.testing.subtest('a'):
      with epy.testing.subtest('b'):
        assert False
  ```

  Args:
    subtests: Subtest fixture

  Yields:
    None
  NzConflicting `subtests` context.)r	   )r   r   r   )r	   Únew_contexts     r   Úwith_subtestsr)   J   sZ   è è € õ: ÐÝ
Ð:Ñ
;Ô
;Ð;Ý¨Ð2Ñ2Ô2€+ðØ€MØ	€E€E€Eà€M€M€Mø�D€MÐÐÐÐs   ª4 ´8)r   r   r   r   )r   r   )r   Ú
__future__r   Ú
contextlibr   Útypingr   r   ÚpytestÚ_SKIP_NON_HERMETICÚmarkÚskipifÚnon_hermeticr   Ú	dataclassr   Úcontextmanagerr&   Úfixturer)   r   r   r   ú<module>r5      s  ðð Ð à "Ð "Ð "Ð "Ð "Ð "à Ð Ð Ð Ø Ð Ð Ð Ø  Ð  Ð  Ð  Ð  Ð  Ð  Ð  à €€€ð
 Ð ð Œ{×!Ò!ØØ'ð "ñ ô €ð €ð Ôð	=ð 	=ð 	=ð 	=ð 	=ñ 	=ô 	=ñ Ôð	=ð Ôðð ð ñ Ôðð$ „ð#ð #ð #ñ „ð#ð #ð #r   