U
    e»{j)  ã                   @   s0   d dl Z d dlZd dlZd dlmZ dd„ ZdS )é    N)Úmake_function_with_signaturec                  C   s€   dd„ } t | dƒ}d ¡ }z|ddƒ W nH tk
rp   t ¡ \}}}|tksRt‚t |¡}d|d kslt‚Y nX t	 
d	¡ d
S )zØ
    Tests that a function made with ``make_function_with_signature`` is give
    the correct line number into the module it was created from (i.e. the line
    ``make_function_with_signature`` was called from).
    c                  _   s   dd  d S )Né   r   © )ÚargsÚkwargsr   r   ú_/var/www/html/bwave/python/venv/lib/python3.8/site-packages/astropy/utils/tests/test_codegen.pyÚcrashy_function   s    zAtest_make_function_with_signature_lineno.<locals>.crashy_function)ÚaÚbzM
    wrapped = make_function_with_signature(crashy_function, ('a', 'b'))
    r   é   z1 / 0éÿÿÿÿz$This should have caused an exceptionN)r   ÚstripÚ	ExceptionÚsysÚexc_infoÚZeroDivisionErrorÚAssertionErrorÚ	tracebackÚ	format_tbÚpytestZfail)r   ÚwrappedÚlineZexc_clsÚexcÚtbZtb_linesr   r   r   Ú(test_make_function_with_signature_lineno   s    

r   )r   r   r   Zastropy.utils.codegenr   r   r   r   r   r   Ú<module>   s   