ó
wŰjc           @   sš   d  d l  Z  d  d l Z d  d l m Z y d  d l Z Wn e k
 rQ d Z n Xe j e d  d e j f d     Y Z	 d e j f d     YZ
 d   Z e d	 k rľ e   n  d S(
   i˙˙˙˙N(   t   test_supports   threading not availablet	   LockTestsc           B   s    e  Z d  Z d   Z d   Z RS(   s)   Very basic test of import lock functions.c         C   s!   |  j  t j   | d |  d  S(   Ns!   expected imp.lock_held() to be %r(   t   assertEqualt   impt	   lock_held(   t   selft   expected(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt   verify_lock_state   s    c         C   sˇ   d } t  j   } |  j |  x+ t |  D] } t  j   |  j t  q, Wx t |  D] } t  j   qZ W|  j |  | sł y t  j   Wn t k
 r˘ qł X|  j d  n  d  S(   Ni2   s5   release_lock() without lock should raise RuntimeError(	   R   R   R   t   ranget   acquire_lockt   Truet   release_lockt   RuntimeErrort   fail(   R   t   LOOPSt   lock_held_at_startt   i(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt   testLock   s    
(   t   __name__t
   __module__t   __doc__R   R   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyR   
   s   	t   ReloadTestsc           B   s)   e  Z d  Z d   Z d   Z d   Z RS(   sP   Very basic tests to make sure that imp.reload() operates just like
    reload().c         C   s0   t  j    d d  l } t j |  Wd  QXd  S(   Ni˙˙˙˙(   R    t   EnvironmentVarGuardt   osR   t   reload(   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt   test_source2   s    c         C   s3   t  j d   d d  l } t j |  Wd  QXd  S(   Nt   timei˙˙˙˙(   R    t   CleanImportR   R   R   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt   test_extension>   s    c         C   s3   t  j d   d d  l } t j |  Wd  QXd  S(   Nt   marshali˙˙˙˙(   R    R   R   R   R   (   R   R   (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt   test_builtinC   s    (   R   R   R   R   R   R   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyR   -   s   		c          C   s   t  t g }  t j |    d  S(   N(   R   R   R    t   run_unittest(   t   tests(    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt	   test_mainI   s    	t   __main__(   R   t   unittestt   testR    t   threadt   ImportErrort   Nonet
   skipUnlesst   TestCaseR   R   R!   R   (    (    (    s   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_imp.pyt   <module>   s   
"	