
    i                     h    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       Zy)	    N)	Generator)contextmanager)Optionalexpected_warningmatchreturnc              #   b  K   t        j                  d      5 }d ddd       D ]w  }t        |j                  |       s|8t	        j
                  |      j                  t        |j                              sTt        d| j                   d|j                         y# 1 sw Y   xY ww)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
   ws       u/Volumes/fast/ai/experiments/voice-extract-mac/.venv/lib/python3.12/site-packages/lightning_utilities/test/warning.pyno_warning_callr      s      
	 	 	- 
. ajj"23"**UZJ[JbJbcfghgpgpcqJr 1%5%>%>$?~aii]![\\  
.	-s'   B/B##B/9B/<'B/#B,(B/)r   r   collections.abcr   
contextlibr   typingr   Warningtyper   r        r   <module>r!      sS    
  % %  6=VZ ]d7m ]hsm ]_h ] ]r    