
    J/Ph_                     X    d dl Z d dlZd dlZd dlZd dlmZ  G d de j                  ZdS )    N)Pathc                       e Zd Zd ZdS )TestUnpickleDeletedModulec                    d                     g d          }d}t          j                    5 }t          j                            |           t          | d| d          }t          |d          }|                    |           |	                                 ddl
m} d	d	d	           n# 1 swxY w Y   t          j        |= t          j        |          }t          j        |          }|                      |d
          d           d	S )a  Create a module that uses Numba, import a function from it.
        Then delete the module and pickle the function. The function
        should load from the pickle without a problem.

        Note - This is a simplified version of how Numba might be used
        on a distributed system using e.g. dask distributed. With the
        pickle being sent to the worker but not the original module.
        
)zfrom numba import vectorizez @vectorize(['float64(float64)'])zdef inc1(x):z    return x + 1
tmp_module/z.pyar   )inc1N      )jointempfileTemporaryDirectorysyspathappendr   openwritecloser   r   modulespickledumpsloadsassertEqual)selfsourcemodnametmp_dirfilenamefr   pkls           h/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/tests/test_unpickle_without_module.py"test_loading_pickle_with_no_modulez<TestUnpickleDeletedModule.test_loading_pickle_with_no_module	   sQ      
 
 (** 
	(gHOOG$$$ w5555566HXs##AGGFOOOGGIII ('''''
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( 
	( K  l4  L1q!!!!!s   A4B--B14B1N)__name__
__module____qualname__r$        r#   r   r      s#        (" (" (" (" ("r)   r   )unittestr   r   r   pathlibr   TestCaser   r(   r)   r#   <module>r-      sr      



       )" )" )" )" )" 1 )" )" )" )" )"r)   