Ë
    Fêñi!  ã                   ój   — d dl Z d dlmZ d dlZ ej                  d¬«      d„ «       Zd„ Zd„ Zd„ Zd	„ Z	y)
é    N)ÚPathÚsession)Úscopec                  ó†   ‡‡‡‡‡— ddl mŠm}  ddlmŠ | dz  Š‰j                  dd¬«       ddd	d
ddddœŠi Šˆˆˆˆˆfd„}|S )zàSession-scoped fixture to cache solution test assets.

    Lazily downloads solution assets into a persistent directory (WEIGHTS_DIR/solution_assets) and returns a callable
    that resolves asset names to cached paths.
    r   )Ú
ASSETS_URLÚWEIGHTS_DIR)Úsafe_downloadÚsolution_assetsT)ÚparentsÚexist_okzsolutions_ci_demo.mp4zdecelera_landscape_min.movzsolution_ci_pose_demo.mp4zsolution_ci_parking_demo.mp4zsolution_vertical_demo.mp4zsolution_ci_parking_areas.jsonzsolutions_ci_parking_model.pt)Ú
demo_videoÚ
crop_videoÚ
pose_videoÚparking_videoÚvertical_videoÚparking_areasÚparking_modelc                 ó‚   •— | ‰vr6‰‰|    z  }|j                  «       s ‰‰› d|j                  › �‰¬«       |‰| <   ‰|    S )zOReturn the cached path for a named solution asset, downloading it on first use.ú/)ÚurlÚdir)ÚexistsÚname)r   Ú
asset_pathr   Úasset_pathsÚassetsÚ	cache_dirr	   s     €€€€€úP/var/www/pod-logistic/pod-ai/venv/lib/python3.12/site-packages/tests/conftest.pyÚ	get_assetz"solution_assets.<locals>.get_asset&   sT   ø€ à�{Ñ"Ø" V¨D¡\Ñ1ˆJØ×$Ñ$Ô&Ù Z L°°*·/±/Ð1BÐ"CÈÕSØ *ˆK˜ÑØ˜4Ñ Ð ó    )Úultralytics.utilsr   r   Úultralytics.utils.downloadsr	   Úmkdir)r   r   r   r   r   r   r	   s     @@@@@r   r
   r
   	   s_   ü€ ÷ :Ý9ð Ð/Ñ/€IØ‡O�O˜D¨4€OÔ0ð
 .Ø2Ø1Ø7Ø6à9Ø8ñ
€Fð €K÷!ð !ð Ðr    c                 ó.   — | j                  dddd¬«       y)z*Add custom command-line options to pytest.ú--slowÚ
store_trueFzRun slow tests)ÚactionÚdefaultÚhelpN)Ú	addoption)Úparsers    r   Úpytest_addoptionr,   2   s   € à
×Ñ�X l¸EÐHXÐÕYr    c                 óv   — | j                  d«      s#|D �cg c]  }d|j                  vsŒ|‘Œ c}|dd yyc c}w )aI  Modify the list of test items to exclude tests marked as slow if the --slow option is not specified.

    Args:
        config: The pytest configuration object that provides access to command-line options.
        items (list): The list of collected pytest item objects to be modified based on the presence of --slow option.
    r%   ÚslowN)Ú	getoptionÚkeywords)ÚconfigÚitemsÚitems      r   Úpytest_collection_modifyitemsr4   7   s9   € ð ×Ñ˜HÔ%à%*ÖJ˜T¨f¸D¿M¹MÒ.I’DÒJˆ‰a‰ð &ùâJs   –6ª6c                 ó   — ddl m}  |«        y)a%  Initialize session configurations for pytest.

    This function is automatically called by pytest after the 'Session' object has been created but before performing
    test collection. It sets the initial seeds for the test session.

    Args:
        session: The pytest session object.
    r   )Ú
init_seedsN)Úultralytics.utils.torch_utilsr6   )r   r6   s     r   Úpytest_sessionstartr8   C   s   € õ 9á…Lr    c                 ód  — ddl m} dD ��cg c]  }|j                  |«      D ]  }|‘Œ Œ }}}ddddg|¢D ]  }t        |«      j	                  d¬	«       Œ d
D ��cg c]  }|j                  |«      D ]  }|‘Œ Œ }}}|dz  |dz  g|¢D ]  }t        j                  |d¬«       Œ yc c}}w c c}}w )aŒ  Cleanup operations after pytest session.

    This function is automatically called by pytest at the end of the entire test session. It removes certain files and
    directories used during testing.

    Args:
        terminalreporter: The terminal reporter object used for terminal output.
        exitstatus (int): The exit status of the test run.
        config: The pytest config object.
    r   )r   >   ú*.onnxú*.torchscriptzdecelera_portrait_min.movzbus.jpgzyolo26n.onnxzyolo26n.torchscriptT)Ú
missing_ok>   ú*.mlpackageú*_openvino_modelr
   zpath with spaces)Úignore_errorsN)r!   r   Úrglobr   ÚunlinkÚshutilÚrmtree)	ÚterminalreporterÚ
exitstatusr1   r   ÚxÚpathÚmodelsÚfileÚ	directorys	            r   Úpytest_terminal_summaryrK   Q   sÖ   € õ .ð 8×Y�qÀK×DUÑDUÐVWÓDXÒY¸DŠdÐYˆdÐY€FÑYØ,¨i¸ÐI^ÐhÐagÐhò +ˆÜˆT‹
×Ñ TÐÕ*ð+ð @×a�qÈK×L]ÑL]Ð^_ÓL`ÒaÀDŠdÐaˆdÐa€FÑaØ!Ð$5Ñ5°{ÐEWÑ7WÐaÐZ`Ðaò 5ˆ	Ü�‰�i¨tÖ4ñ5ùó Zùó
 bs   ŒB&ÁB,)
rB   Úpathlibr   ÚpytestÚfixturer
   r,   r4   r8   rK   © r    r   ú<module>rP      sF   ðó Ý ã ð €‡��iÔ ñ%ó !ð%òPZò
	Kòó5r    