U
    ?h                     @   s*   d dl Z d dlZdd ZG dd dZdS )    Nc                  C   s   dd l } td| j  d S )Nr   zskimage version )skimageprint__version__)r    r   H/var/www/html/venv/lib/python3.8/site-packages/skimage/_shared/tester.py_show_skimage_info   s    r   c                   @   s"   e Zd ZdZdd Zdd	d
ZdS )PytestTesteraX  
    Pytest test runner.

    This class is made available in ``skimage._shared.testing``, and a test
    function is typically added to a package's __init__.py like so::

      from skimage._shared.testing import PytestTester
      test = PytestTester(__name__)
      del PytestTester

    Calling this test function finds and runs all tests associated with the
    module and all its sub-modules.

    Attributes
    ----------
    module_name : str
        Full path to the package to test.

    Parameters
    ----------
    module_name : module name
        The name of the module to test.

    c                 C   s
   || _ d S )N)module_name)selfr	   r   r   r   __init__#   s    zPytestTester.__init__fast   NFc              
   C   s<  ddl }tj| j }	tj|	jd }
dg}|dg7 }|dddg7 }|rPtd|r`|t	|7 }|d	kr~|d
d|d	   g7 }|r|d|
 g7 }|dkr|ddg7 }n|dkr|d|g7 }|dkr|d| g7 }|dkr| jg}|dgt	| 7 }t
  z||}W n* tk
r2 } z
|j}W 5 d}~X Y nX |dkS )ar  
        Run tests for module using pytest.

        Parameters
        ----------
        label : {'fast', 'full'}, optional
            Identifies the tests to run. When set to 'fast', tests decorated
            with `pytest.mark.slow` are skipped, when 'full', the slow marker
            is ignored.
        verbose : int, optional
            Verbosity value for test outputs, in the range 1-3. Default is 1.
        extra_argv : list, optional
            List with any extra arguments to pass to pytests.
        doctests : bool, optional
            .. note:: Not supported
        coverage : bool, optional
            If True, report coverage of scikit-image code. Default is False.
            Requires installation of (pip) pytest-cov.
        durations : int, optional
            If < 0, do nothing, If 0, report time of all tests, if > 0,
            report the time of the slowest `timer` tests. Default is -1.
        tests : test or list of tests
            Tests to be executed with pytest '--pyargs'

        Returns
        -------
        result : bool
            Return True on success, false otherwise.
        r   Nz-lz-qz!-W ignore:Not importing directoryz"-W ignore:numpy.dtype size changedz"-W ignore:numpy.ufunc size changedzDoctests not supportedr   -vz--cov=r   z-mznot slowfullz--durations=z--pyargs)pytestsysmodulesr	   ospathabspath__path__
ValueErrorlistr   main
SystemExitcode)r
   labelverboseZ
extra_argvZdoctestsZcoverageZ	durationsZtestsr   modulemodule_pathZpytest_argsr   excr   r   r   __call__&   sB    
zPytestTester.__call__)r   r   NFFr   N)__name__
__module____qualname____doc__r   r#   r   r   r   r   r   
   s           r   )r   r   r   r   r   r   r   r   <module>   s   