U
    e»{jí  ã                   @   s,   d dl mZ d dlZd dlmZ dd„ ZdS )é    )ÚwrapsN)ÚHAS_PYTEST_MPLc                     sZ   ˆ   dd¡‰ˆ   di ¡‰ˆ   di ¡‰ddiˆd< ‡ ‡‡‡fdd	„}t| ƒd
krV|| Ž S |S )zò
    A decorator that defines a figure test.

    This automatically decorates tests with mpl_image_compare with common
    options used by all figure tests in astropy, and also adds the decorator
    to allow remote data to be accessed.
    Ú	tolerancer   ÚstyleÚsavefig_kwargsZSoftwareNÚmetadatac                    sL   t jjt jjf ˆˆˆdœˆ—Žt jjt dd�tˆ ƒ‡ fdd„ƒƒƒƒ}|S )N)r   r   r   z+pytest-mpl is required for the figure tests)Úreasonc                     s
   ˆ | |ŽS )N© )ÚargsÚkwargs©Útest_functionr	   ú\/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/tests/figures/helpers.pyÚtest_wrapper   s    	z4figure_test.<locals>.decorator.<locals>.test_wrapper)ÚpytestÚmarkZremote_dataZmpl_image_compareZskipifr   r   )r   r   ©r   r   r   r   r   r   Ú	decorator   s      ÿÿ ÿzfigure_test.<locals>.decoratoré   )ÚpopÚlen)r
   r   r   r	   r   r   Úfigure_test
   s    r   )Ú	functoolsr   r   Z"astropy.utils.compat.optional_depsr   r   r	   r	   r	   r   Ú<module>   s   