a
    xˆcÞ  ã                   @   sf   d dl mZ d dlZddlmZ ddlmZ ddlmZ G dd	„ d	e	ƒZ
d
d„ Zdd„ Zddd„ZdS )é    )Úabsolute_importNé   )Ú
assertionsé   )Úexc)Ú_warnings_warnc                   @   s   e Zd ZdZdS )ÚSATestSuiteWarningzÀwarning for a condition detected during tests that is non-fatal

    Currently outside of SAWarning so that we can work around tools like
    Alembic doing the wrong thing with warnings.

    N)Ú__name__Ú
__module__Ú__qualname__Ú__doc__© r   r   ú^/home/yuhw/wc/wire-cell-python/wcpy/lib/python3.9/site-packages/sqlalchemy/testing/warnings.pyr      s   r   c                 C   s   t | td� d S )N©Úcategory)r   r   )Úmessager   r   r   Úwarn_test_suite   s    r   c                  C   s¬   d} t jdtjd� t jdtjd� t jdtjd� t jdtd� t jdt| d� t jdtjdd� t jdtjd	d� zd
dl}W n t	y”   Y n0 t jd|j
| d� dS )z/Set global warning behavior for the test suite.z^(?:test|sqlalchemy)\..*Úignorer   ÚerrorÚalways)r   Úmodulez.*\(deprecated since: 2.0\)$)r   r   z8^The (Sybase|firebird) dialect is deprecated and will ber   NÚonce)ÚwarningsÚfilterwarningsÚsa_excZSAPendingDeprecationWarningZSADeprecationWarningÚ	SAWarningr   ÚDeprecationWarningÚpytestÚImportErrorZPytestDeprecationWarning)Úoriginr   r   r   r   Úsetup_filters   s6    ÿÿýýÿr    Fc                 C   s<   t jtj||d�� | ƒ W  d  ƒ S 1 s.0    Y  dS )zzAssert that each of the given warnings are emitted by fn.

    Deprecated.  Please use assertions.expect_warnings().

    )ÚregexN)r   Z_expect_warningsr   r   )ÚfnZwarning_msgsr!   r   r   r   Úassert_warningsH   s    ÿr#   )F)Ú
__future__r   r   Ú r   r   r   Zutil.langhelpersr   ÚWarningr   r   r    r#   r   r   r   r   Ú<module>   s   	*