
    IR-e4                     l    d dl mZ d dlmZ d dlZd dlZd dlmZ d dlm	Z	m
Z
mZ d Zd Zd Zd	 Zd
 ZdS )    )
namedtuple)mockN)introspection)find_current_modulefind_mod_objs
minversionc                      d} d}d}t          d          j        | k    sJ t          d          j        |k    sJ t          dd          j        |k    sJ dS )z
    Tests that the `find_current_module` function works. Note that
    this also implicitly tests compat.misc._patched_getmodule
    astropy.utils.introspection&astropy.utils.tests.test_introspectionr      TN)r   __name__mod1mod2mod3s      Flib/python3.11/site-packages/astropy/utils/tests/test_introspection.pytest_pkg_finderr      so    
 )D3D3Dq!!*d2222q!!*d2222q$''0D888888    c                     ddl m}  t          }t          d          t          u sJ t          d          j        |k    sJ t           |             dz             J t          dd          j        |k    sJ t          dt          g          j        |k    sJ t          ddg          j        |k    sJ t          j        t                    5  t          ddg           d d d            d S # 1 swxY w Y   d S )Nr   )getrecursionlimitr   Tr
   &faddfdsasewrweriopunjlfiurrhujnkflgwhu)sysr   r   r   r   pytestraisesImportError)r   	thismodnms     r   test_find_current_modr      sm   %%%%%%Iq!!]2222q!!*i77770022Q677???q$''0I====q=/22;yHHHHq#@"ABBKyXXXX	{	#	# K KA HIJJJK K K K K K K K K K K K K K K K K Ks   C,,C03C0c                     t          d          \  } }}dd l}d| v sJ |j        |v sJ t          t          d          \  } }}d| v sJ d|v sJ t          |v sJ t          t          d          \  } }}d| vsJ d|vsJ t          |vsJ d S )	Nastropyr   testF)
onlylocalsr   zcollections.namedtupleT)r   r   r    r   r   )lnmsfqnsobjsr   s       r   test_find_mod_objsr%   ,   s    $Y//D$ NNN T>>>><4$X%@@@D$4#t++++$X$???D$t#####4////T!!!!!!r   c                     dd l } g d}ddg}|D ]&}t          | |          sJ t          d|          sJ '|D ]&}t          | |          rJ t          d|          rJ 't          t          d          sJ t          dd          sJ d S )Nr   )z1.16z1.16.1z
1.16.0.devz1.16dev100000z100000.2rc1numpyz3.1yaml)r(   r   r)   )r(   good_versionsbad_versionsversions       r   test_minversionr-   C   s    LLL???Mm,L  , ,%)))))'7++++++ 0 0eW-----gw//////dE"""""fe$$$$$$$r   c                     t          j        dd          5  d} d}d}t          d          j        | k    sJ t          d          j        |k    sJ t          dd          j        |k    sJ 	 ddd           dS # 1 swxY w Y   dS )	a  
    Tests that the `find_current_module` function would work if used inside
    an application bundle. Since we can't test this directly, we test what
    would happen if inspect.getmodule returned `None`, which is what happens
    inside PyInstaller and py2app bundles.
    zinspect.getmoduleN)return_valuer
   r   r   r   T)r   patchr   r   r   s      r   test_find_current_module_bundler1   S   s     
'd	;	;	; = =,77"1%%.$6666"1%%.$6666"1d++4<<<<<= = = = = = = = = = = = = = = = = =s   AA;;A?A?)collectionsr   unittestr   r   r)   astropy.utilsr   astropy.utils.introspectionr   r   r   r   r   r%   r-   r1    r   r   <module>r7      s    # " " " " "         ' ' ' ' ' ' V V V V V V V V V V
9 
9 
9K K K"" " ".% % % = = = = =r   