o
    fi                     @   s`   d dl Z d dlZd dlmZ d dlmZ d dlmZ eedfde	e dee
 defdd	ZdS )
    N)	Generator)contextmanager)Optionalexpected_warningmatchreturnc                 c   s    t jdd}dV  W d   n1 sw   Y  |D ]#}t|j| r?|du s3t|t|jr?t	d| j
 d|jqdS )a_  Assert that no matching warning is emitted within the context.

    Args:
        expected_warning: The warning class (or subclass) to check for.
        match: Optional regular expression to match against the warning message.

    Raises:
        AssertionError: If a warning of the given type (and matching the regex, if provided) is captured.

    T)recordN`z` was raised: )warningscatch_warnings
issubclasscategoryrecompilesearchstrmessageAssertionError__name__)r   r   r   w r   ^/home/ubuntu/SoloSpeech/.venv/lib/python3.10/site-packages/lightning_utilities/test/warning.pyno_warning_call   s   *r   )r   r
   collections.abcr   
contextlibr   typingr   Warningtyper   r   r   r   r   r   <module>   s   *