B
    lc                 @  sJ   d Z ddlmZ ddlZddlmZ dd Zejdd	d
dddZdS )z
pytest plugin functions
    )annotationsN   )DataFetcherc             C  s   | j ddddd d S )Nz--regression
store_trueFz?run regression tests. Download data for those tests if required)actiondefaulthelp)Z	addoption)parser r
   2lib/python3.7/site-packages/dials_data/pytest11.pypytest_addoption   s
    r   Zsession)Zscoper   )returnc             C  s4   | j dstd t }dd }t|d| |S )z
    Return the location of a regression dataset as py.path object.
    Download the files if they are not on disk already.
    Skip the test if the dataset can not be downloaded.
    z--regressionz)Test requires --regression option to run.c             S  s   | st d | S )NzPTest data could not be downloaded. Your version of dials.data may be out of date)pytestZfail)resultr
   r
   r   fail_test_if_lookup_failed!   s    z.dials_data.<locals>.fail_test_if_lookup_failedZresult_filter)ZconfigZ	getoptionr   skipr   setattr)ZrequestZdfr   r
   r
   r   
dials_data   s    
r   )	__doc__Z
__future__r   r   Zdownloadr   r   Zfixturer   r
   r
   r
   r   <module>   s
   	