Ë
    MÚZd  ã                   ó2   — d Z ddlZddlZ G d„ d«      Zd„ Zy)zN
This module adds context manager for temporary files generated by the tests.
é    Nc                   ód   — e Zd ZdZ ed«      Z ed«      Zedd„«       Zedd„«       Z	ed„ «       Z
y)ÚTmpFileManagerzP
    A class to track record of every temporary files created by the tests.
    Ú c                 ó<   — | j                   j                  |«       |S ©N)Ú	tmp_filesÚadd©ÚclsÚnames     ú8/usr/lib/python3/dist-packages/sympy/testing/tmpfiles.pyÚtmp_filezTmpFileManager.tmp_file   s   € à‰×Ñ˜$ÔØˆó    c                 ó<   — | j                   j                  |«       |S r   )Útmp_foldersr	   r
   s     r   Ú
tmp_folderzTmpFileManager.tmp_folder   s   € à‰×Ñ˜DÔ!Øˆr   c                 ód  — | j                   r[| j                   j                  «       }t        j                  j	                  |«      rt        j
                  |«       | j                   rŒ[| j                  r=| j                  j                  «       }t        j                  |«       | j                  rŒ<y y r   )	r   ÚpopÚosÚpathÚisfileÚremover   ÚshutilÚrmtree)r   ÚfileÚfolders      r   ÚcleanupzTmpFileManager.cleanup   so   € àmŠmØ—=‘=×$Ñ$Ó&ˆDÜw‰w~‰~˜dÔ#Ü—	‘	˜$”ð m‹mð oŠoØ—_‘_×(Ñ(Ó*ˆFÜM‰M˜&Ô!ð oor   N)r   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úsetr   r   Úclassmethodr   r   r   © r   r   r   r   	   sU   „ ññ B“€IÙb“'€Kàòó ðð òó ðð ñ"ó ñ"r   r   c                 ó   ‡ — ˆ fd„}|S )zP
    A decorator to help test codes remove temporary files after the tests.
    c                  óp   •— 	  ‰ «        t         j                  «        y # t         j                  «        w xY wr   )r   r   )Ú	test_funcs   €r   Úwrapper_functionz+cleanup_tmp_files.<locals>.wrapper_function(   s&   ø€ ð	%ÙŒKä×"Ñ"Õ$øŒN×"Ñ"Õ$ús   ƒ Ÿ5r$   )r'   r(   s   ` r   Úcleanup_tmp_filesr)   $   s   ø€ ô%ð Ðr   )r!   r   r   r   r)   r$   r   r   ú<module>r*      s!   ðñó Û 	÷"ñ "ó6
r   