
    Ɔc                         d Z ddlZddlZddlZddlmZ dZ eg           Z eg           Z	d eg           iZ
d Z G d dej                  ZdS )zL
This module provides the tools used to internally run the erfa test suite.
    N)LooseVersionFc                     t          t          j                                                  D ].} t	          | t
          j                  rt          | d          r| `/t          sdS t          j                     t          j        dt                     t          D ]"}	 t          |           # t           $ r Y w xY wt          j                     t          t"          t$          g}|D ]}t          j        dd|           t(          D ]}|D ]}t          j        d||           t*          D ]N}|t          j        dd         |k    r2t*          |         D ]$}t          j        d|d         |d	                    %O	 ddl}t1          |j                  d
k     rt          j        dt          d           dS dS # t           $ r Y dS w xY w)z
    Turn all DeprecationWarnings (which indicate deprecated uses of
    Python itself or Numpy) into exceptions so that we find
    out about them early.

    This completely resets the warning filters and any "already seen"
    warning state.
    __warningregistry__Nignoreerrorz.*)categorymodule   r      3znumpy.lib.type_check)listsysmodulesvalues
isinstancetypes
ModuleTypehasattrr   _deprecations_as_exceptionswarningsresetwarningssimplefilterDeprecationWarning_modules_to_ignore_on_import
__import__ImportErrorFutureWarningImportWarningfilterwarnings!_warnings_to_ignore_entire_module_warnings_to_ignore_by_pyverversion_info
matplotlibr   __version__)r	   m
_all_warnswvsr#   s          1lib/python3.11/site-packages/erfa/tests/helper.py treat_deprecations_as_exceptionsr+      sM    s{))++,, + + vu/00 	+ 566	+*&  ($6777 *  	qMMMM 	 	 	D	 $m]CJ 2 2q1111 / D D 	D 	DA#HqCCCCC	D * > > 	>(!,1 	>1!4 > >'!A$!====C 
.//#5 	C#H7I+AC C C C C C	C 	C    s$   B++
B87B8:F6 6
GGc                   2     e Zd ZdZ fdZ fdZd Z xZS )catch_warningsa.  
    A high-powered version of warnings.catch_warnings to use for testing
    and to make sure that there is no dependence on the order in which
    the tests are run.

    This completely blitzes any memory of any warnings that have
    appeared before so that all warnings will be caught and displayed.

    ``*args`` is a set of warning classes to collect.  If no arguments are
    provided, all warnings are collected.

    Use as follows::

        with catch_warnings(MyCustomWarning) as w:
            do.something.bad()
        assert len(w) > 0
    c                 Z    t                                          d           || _        d S )NT)record)super__init__classes)selfr2   	__class__s     r*   r1   zcatch_warnings.__init__k   s)    %%%    c                 $   t                                                      }t                       t          | j                  dk    rt          j        d           n3t          j        d           | j        D ]}t          j        d|           |S )Nr   alwaysr   )r0   	__enter__r+   lenr2   r   r   )r3   warning_listclsr4   s      r*   r8   zcatch_warnings.__enter__o   s    ww((**(***t|! 	5!(++++!(+++| 5 5%h4444r5   c                 "    t                       d S )N)r+   )r3   typevalue	tracebacks       r*   __exit__zcatch_warnings.__exit__z   s    (*****r5   )__name__
__module____qualname____doc__r1   r8   r@   __classcell__)r4   s   @r*   r-   r-   X   sj         $    	 	 	 	 	+ + + + + + +r5   r-   )rD   r   r   r   distutils.versionr   r   setr   r    r!   r+   r-    r5   r*   <module>rI      s     


   * * * * * * $ "s2ww $'CGG !##b''  
AC AC ACH#+ #+ #+ #+ #+X, #+ #+ #+ #+ #+r5   