
    i                     2    d dl Z d dlZd dlmZ ddZddZdS )    N)errorsreturnc                  |   t          j        dd          } dt           j        ddfd}t          j        t
          j                  5 }|                     dt          j        d	          |
          dt           j	        ddfd            }ddd           n# 1 swxY w Y   t          |j                  dk    sJ dS )zM
    Test that a sync function can not have an async on_failure handler.
    testFapp_idis_productionctxr   Nc                 
   K   d S N r
   s    \/root/projects/qq-shell/venv/lib/python3.11/site-packages/inngest/_internal/function_test.py
on_failurez6test_sync_fn_with_async_on_failure.<locals>.on_failure   s          fooeventfn_idtriggerr   c                     d S r   r   r   s    r   fnz.test_sync_fn_with_async_on_failure.<locals>.fn   s	     Dr   zKa non-async function cannot have an async on_failure handler (function foo))inngestInngestContextpytestraisesr   Errorcreate_functionTriggerEventContextSyncstrvalueclientr   er   s       r   "test_sync_fn_with_async_on_failurer(      s4   
 _F%@@@Fgo $     
v|	$	$ 			(u555! 
  

 


	G' 	D 	 	 	

 


	               	AGX	Y 	Y 	Y 	Y 	Y 	Y   ABBBc                  |   t          j        dd          } dt           j        ddfd}t          j        t
          j                  5 }|                     dt          j        d	          |
          dt           j	        ddfd            }ddd           n# 1 swxY w Y   t          |j                  dk    sJ dS )zM
    Test that an async function can not have a sync on_failure handler.
    r   Fr   r
   r   Nc                     d S r   r   r   s    r   r   z6test_async_fn_with_sync_on_failure.<locals>.on_failure(   s    r   r   r   r   c                 
   K   d S r   r   r   s    r   r   z.test_async_fn_with_sync_on_failure.<locals>.fn-   s       Dr   zKan async function cannot have a non-async on_failure handler (function foo))r   r   r"   r   r   r   r   r    r!   r   r#   r$   r%   s       r   "test_async_fn_with_sync_on_failurer-   !   s4   
 _F%@@@F+      
v|	$	$ 			(u555! 
  

 


	'/ 	d 	 	 	

 


	               	AGX	Y 	Y 	Y 	Y 	Y 	Yr)   )r   N)r   r   inngest._internalr   r(   r-   r   r   r   <module>r/      s[      $ $ $ $ $ $   4     r   