B
     \i                 @   sn   d dl mZ d dlZd dlm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rje  dS )
    )print_functionN)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   7lib/python3.7/site-packages/numba/tests/test_numconv.pycast
   s    z'template.<locals>.closure.<locals>.cast)argsZreturn_type   )r   ZassertAlmostEqualZentry_point)selfr	   Zcres)fromtytotyr   r   closure	   s    ztemplate.<locals>.closurer   )r   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   sL   t jt jB }x:tj|ddD ](\}}dj||d}t| |t|| qW d S )N   )rztest_{fromty}_to_{toty})r   r   )r   Zinteger_domainZreal_domain	itertoolspermutationsformatsetattrr   )clsZtysr   r   Z	test_namer   r   r   automatic_populate   s
    z'TestNumberConversion.automatic_populateN)__name__
__module____qualname____doc__classmethodr   r   r   r   r   r      s   r   __main__)Z
__future__r   r   Znumba.unittest_supportZunittest_supportZunittestZnumba.compilerr   Znumbar   r   ZTestCaser   r   r   mainr   r   r   r   <module>   s   