U
    e»{jQ  ã                   @   sD   d Z ddlZddlZddlmZ ddgZd	dd„Zejdd„ ƒZdS )
zž
This module provides the tools used to internally run the cosmology test suite
from the installed astropy.  It makes use of the `pytest`_ testing framework.
é    N)ÚcoreÚget_redshift_methodsÚclean_registryTc           	   	   C   s<  t ƒ }t| ƒD ]L}zt| |ƒ}W n tk
r8   Y qY nX t|ƒr| d¡rP|r| |¡ qt | ¡rjdnd}t	|ƒD ]À}zt 
t| |ƒ¡}W n" tk
r°   | |¡ Y qvY nX t|j ¡ ƒ}t|ƒ|krØ| |¡ qvt|ƒ|d k�r||  d¡�s| |¡ qv|svt|ƒ|d krv||d   d¡rv| |¡ qv|S )a  Get redshift methods from a cosmology.

    Parameters
    ----------
    cosmology : |Cosmology| class or instance
    include_private : bool
        Whether to include private methods, i.e. starts with an underscore.
    include_z2 : bool
        Whether to include methods that are functions of 2 (or more) redshifts,
        not the more common 1 redshift argument.

    Returns
    -------
    set[str]
        The names of the redshift methods on `cosmology`, satisfying
        `include_private` and `include_z2`.
    Ú_é   r   Úzé   )ÚsetÚdirÚgetattrÚNotImplementedErrorÚcallableÚ
startswithÚaddÚinspectÚisclassÚtupleÚ	signatureÚ
ValueErrorÚdiscardÚlistÚ
parametersÚkeysÚlen)	Z	cosmologyZinclude_privateZ
include_z2ÚmethodsÚnÚmZiz1ÚsigÚparams© r   ú]/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/cosmology/tests/helper.pyr      s<    


ÿÿþýc                  c   s   t j} i t _t jV  | t _dS )zC`pytest.fixture` for clearing and restoring ``_COSMOLOGY_CLASSES``.N)r   Z_COSMOLOGY_CLASSES)ZORIGINAL_COSMOLOGY_CLASSESr   r   r    r   [   s    )TT)	Ú__doc__r   ZpytestZastropy.cosmologyr   Ú__all__r   Zfixturer   r   r   r   r    Ú<module>   s   	
A