o
    8ήc3                     @   sb   d dl Z d dlZd dlmZ d dlmZ dd ZG dd dejZe	  e
dkr/e  dS dS )	    N)compile_isolated)typesc                    s    fdd}|S )Nc                    s.   dd }t | gd}| |dd d S )Nc                 S   s   | }|S )N )xyr   r   ?/tmp/pip-target-vg8gfxp4/lib/python/numba/tests/test_numconv.pycast	   s   z'template.<locals>.closure.<locals>.cast)argsreturn_type   )r   assertAlmostEqualentry_point)selfr   cresfromtytotyr   r   closure   s   ztemplate.<locals>.closurer   )r   r   r   r   r   r   template   s   r   c                   @   s   e Zd ZdZedd ZdS )TestNumberConversionz
    Test all int/float numeric conversion to ensure we have all the external
    dependencies to perform these conversions.
    c                 C   sH   t jt jB }tj|ddD ]\}}dj||d}t| |t|| qd S )N   )rztest_{fromty}_to_{toty}r   )r   integer_domainreal_domain	itertoolspermutationsformatsetattrr   )clstysr   r   	test_namer   r   r   automatic_populate   s   z'TestNumberConversion.automatic_populateN)__name__
__module____qualname____doc__classmethodr!   r   r   r   r   r      s    r   __main__)r   unittestnumba.core.compilerr   
numba.corer   r   TestCaser   r!   r"   mainr   r   r   r   <module>   s    