ó
‹wÛjc           @   s  d  Z  d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l	 Z	 d d l
 Z
 d d l Z d d l Z d d l Z d d l m Z m Z d d l Z d d l Z d d l Z d d l m Z m Z m Z d d l Z d d l Z d d l Z d d l Z d d l Z y d d l Z Wn e k
 r]e Z n Xd e j  f d „  ƒ  YZ! d e! f d „  ƒ  YZ" d	 e! f d
 „  ƒ  YZ# d Z$ d Z% d Z& d Z' d Z( d Z) d Z* d Z+ d Z, d Z- e. e- e$ d ƒ Z/ i
 d e$ 6d e% 6d e& 6d e' 6d e( 6d e) 6d e* 6d e+ 6d e, 6d e- 6Z0 d  e j1 f d! „  ƒ  YZ2 d" e j1 f d# „  ƒ  YZ3 d$ e! f d% „  ƒ  YZ4 d& e! f d' „  ƒ  YZ5 d( e j6 f d) „  ƒ  YZ7 d* e! f d+ „  ƒ  YZ8 d, e f d- „  ƒ  YZ9 d. e f d/ „  ƒ  YZ: e j; e d0 ƒ d1 e! f d2 „  ƒ  Yƒ Z< d3 e! f d4 „  ƒ  YZ= d5 e! f d6 „  ƒ  YZ> d7 e! f d8 „  ƒ  YZ? e d9 „ Z@ d: „  ZA d; e jB f d< „  ƒ  YZC d= e! f d> „  ƒ  YZD d? e! f d@ „  ƒ  YZE dA e! f dB „  ƒ  YZF dC e! f dD „  ƒ  YZG e dE dF ƒ dG „  ƒ ZH eI dH k reH ƒ  n  d S(I   so   Test harness for the logging module. Run all tests.

Copyright (C) 2001-2013 Vinay Sajip. All Rights Reserved.
iÿÿÿÿN(   t   ThreadingTCPServert   StreamRequestHandler(   t   captured_stdoutt   run_with_localet   run_unittestt   BaseTestc           B   sG   e  Z d  Z d Z d Z d Z d „  Z d „  Z d d „ Z	 d „  Z
 RS(	   s   Base class for logging tests.s&   %(name)s -> %(levelname)s: %(message)ss   ^([\w.]+) -> ([\w]+): ([\d]+)$i    c         C   s"  t  j ƒ  j j } t  j ƒ  zD t  j j ƒ  |  _ t  j |  _	 | j ƒ  |  _
 t  j j ƒ  |  _ Wd t  j ƒ  Xt  j d ƒ t  j d ƒ t  j d ƒ |  _ |  j j ƒ  |  _ t j ƒ  |  _ |  j j t  j ƒ t  j |  j ƒ |  _ t  j |  j ƒ |  _ |  j j |  j ƒ |  j j |  j ƒ d S(   sx   Setup the default logging stream to an internal StringIO instance,
        so that we can examine log output as we want.Ns   «×»u   Ä¿Ã–Gt    (   t   loggingt	   getLoggert   managert
   loggerDictt   _acquireLockt	   _handlerst   copyt   saved_handlerst   _handlerListt   saved_handler_listt   saved_loggerst   _levelNamest   saved_level_namest   _releaseLockt   root_loggert   getEffectiveLevelt   original_logging_levelt	   cStringIOt   StringIOt   streamt   setLevelt   DEBUGt   StreamHandlert	   root_hdlrt	   Formattert
   log_formatt   root_formattert   setFormattert
   addHandler(   t   selft   logger_dict(    (    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_logging.pyt   setUp;   s$    
c         C   s	  |  j  j ƒ  |  j j |  j ƒ x: |  j j r\ |  j j d } |  j j | ƒ | j ƒ  q# W|  j j |  j ƒ t j	 ƒ  z} t j
 j ƒ  t j
 j |  j ƒ t j j ƒ  t j j |  j ƒ |  j t j (t j ƒ  j j } | j ƒ  | j |  j ƒ Wd t j ƒ  Xd S(   sJ   Remove our logging stream, and restore the original logging
        level.i    N(   R   t   closeR   t   removeHandlerR   t   handlersR   R   R   R   R   t   cleart   updateR   R   R   R   R   R   R	   R
   R   R   (   R$   t   hR
   (    (    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_logging.pyt   tearDownX   s$    

c   	      C   s  | p |  j  } t j |  j ƒ } y | j ƒ  | j ƒ  } Wn# t k
 r` | j ƒ  j ƒ  } n X|  j	 t
 | ƒ t
 | ƒ ƒ xb t | | ƒ D]Q \ } } | j | ƒ } | sÂ |  j d | ƒ n  |  j	 t | j ƒ  ƒ | ƒ q� W| j ƒ  } | r|  j d | ƒ n  d S(   s±   Match the collected log lines against the regular expression
        self.expected_log_pat, and compare the extracted group values to
        the expected_values list of tuples.s*   Log line does not match expected pattern:
s'   Remaining output at end of log stream:
N(   R   t   ret   compilet   expected_log_patt   resett	   readlinest   AttributeErrort   getvaluet
   splitlinest   assertEqualt   lent   zipt   searcht   failt   tuplet   groupst   read(	   R$   t   expected_valuesR   t   patt   actual_linest   actualt   expectedt   matcht   s(    (    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_logging.pyt   assert_log_lineso   s"    
	 c         C   s   |  j  d 7_  d |  j  S(   sM   Generate a message consisting solely of an auto-incrementing
        integer.i   s   %d(   t   message_num(   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_logging.pyt   next_message†   s    N(   t   __name__t
   __module__t   __doc__R    R0   RF   R&   R-   t   NoneRE   RG   (    (    (    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_logging.pyR   3   s   		t   BuiltinLevelsTestc           B   s;   e  Z d  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s*   Test builtin levels and their inheritance.c         C   sš  |  j  } t j d ƒ } | j t j ƒ t j d ƒ } | j t j ƒ t j d ƒ } | j t j ƒ | j t j | ƒ  ƒ | j	 | ƒ  ƒ | j t j | ƒ  ƒ | j	 | ƒ  ƒ | j
 | ƒ  ƒ | j | ƒ  ƒ | j t j | ƒ  ƒ | j	 | ƒ  ƒ | j
 | ƒ  ƒ | j | ƒ  ƒ | j | ƒ  ƒ | j
 | ƒ  ƒ | j | ƒ  ƒ | j | ƒ  ƒ | j | ƒ  ƒ |  j d d d d d d d d d d d g ƒ d  S(   Nt   ERRt   INFt   DEBt   CRITICALt   1t   ERRORt   2t   3t   4t   WARNINGt   5t   INFOt   6t   7t   8t   9t   10R   t   11(   RM   RP   RQ   (   RM   RR   RS   (   RN   RP   RT   (   RN   RR   RU   (   RN   RV   RW   (   RN   RX   RY   (   RO   RP   RZ   (   RO   RR   R[   (   RO   RV   R\   (   RO   RX   R]   (   RO   R   R^   (   RG   R   R   R   RR   RX   R   t   logRP   t   errort   warnt   infot   debugRE   (   R$   t   mRM   RN   RO   (    (    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_logging.pyt	   test_flat�   sD    	c         C   s´   |  j  } t j d ƒ } | j t j ƒ t j d ƒ } | j t j ƒ | j t j | ƒ  ƒ | j | ƒ  ƒ | j	 | ƒ  ƒ | j
 | ƒ  ƒ | j | ƒ  ƒ |  j d d g ƒ d  S(	   NRN   s   INF.ERRRP   RQ   RR   RS   (   s   INF.ERRRP   RQ   (   s   INF.ERRRR   RS   (   RG   R   R   R   RX   RR   R_   RP   R`   Ra   Rb   Rc   RE   (   R$   Rd   RN   t   INF_ERR(    (    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_logging.pyt   test_nested_explicit¿   s    	c      	   C   sC  |  j  } t j d ƒ } | j t j ƒ t j d ƒ } | j t j ƒ t j d ƒ } t j d ƒ } t j d ƒ } | j t j | ƒ  ƒ | j | ƒ  ƒ | j	 | ƒ  ƒ | j
 | ƒ  ƒ | j t j | ƒ  ƒ | j | ƒ  ƒ | j | ƒ  ƒ | j	 | ƒ  ƒ | j
 | ƒ  ƒ | j | ƒ  ƒ |  j d d d d d d g ƒ d  S(   NRN   s   INF.ERRs	   INF.UNDEFs   INF.ERR.UNDEFt   UNDEFRP   RQ   RR   RS   RV   RT   RX   RU   RW   RY   (   s	   INF.UNDEFRP   RQ   (   s	   INF.UNDEFRR   RS   (   s	   INF.UNDEFRV   RT   (   s	   INF.UNDEFRX   RU   (   s   INF.ERR.UNDEFRP   RW   (   s   INF.ERR.UNDEFRR   RY   (   RG   R   R   R   RX   RR   R_   RP   R`   Ra   Rb   Rc   RE   (   R$   Rd   RN   Rf   t	   INF_UNDEFt   INF_ERR_UNDEFRh   (    (    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_logging.pyt   test_nested_inheritedÖ   s2    	c         C   sÏ   |  j  } t j d ƒ } t j d ƒ } t j d ƒ } | j t j ƒ | j t j | ƒ  ƒ | j | ƒ  ƒ | j t j | ƒ  ƒ | j | ƒ  ƒ | j | ƒ  ƒ | j | ƒ  ƒ |  j	 d
 d d d g ƒ d  S(   NRN   s   INF.BADPARENT.UNDEFs   INF.BADPARENTRP   RQ   RX   RS   RT   RU   (   s   INF.BADPARENT.UNDEFRP   RQ   (   s   INF.BADPARENT.UNDEFRX   RS   (   s   INF.BADPARENTRP   RT   (   s   INF.BADPARENTRX   RU   (
   RG   R   R   R   RX   R_   t   FATALRb   Rc   RE   (   R$   Rd   RN   t
   GRANDCHILDt   CHILD(    (    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_logging.pyt   test_nested_with_virtual_parentù   s     	c         C   s   |  j  t t j t ƒ d  S(   N(   t   assertRaisest	   TypeErrorR   R   t   any(   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_logging.pyt   test_invalid_name  s    (   RH   RI   RJ   Re   Rg   Rk   Ro   Rs   (    (    (    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_logging.pyRL   �   s   	/		#	t   BasicFilterTestc           B   s   e  Z d  Z d „  Z RS(   s   Test the bundled Filter class.c         C   sà   t  j d ƒ } |  j j d } z¬ | j | ƒ t  j d ƒ } t  j d ƒ } t  j d ƒ } t  j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d	 d
 g ƒ Wd  | j	 | ƒ Xd  S(   Ns	   spam.eggsi    t   spams   spam.eggs.fishs   spam.bakedbeansRX   RS   RT   (   s	   spam.eggsRX   RS   (   s   spam.eggs.fishRX   RT   (
   R   t   FilterR   R)   t	   addFilterR   Rb   RG   RE   t   removeFilter(   R$   t   filter_t   handlerRu   t	   spam_eggst   spam_eggs_fisht   spam_bakedbeans(    (    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_logging.pyt   test_filter  s     (   RH   RI   RJ   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_logging.pyRt     s   ix   iw   iv   iu   it   is   ir   iq   ip   io   i   t   Silentt   Taciturnt   Terset   Effusivet   Sociablet   Verboset	   Talkativet	   Garruloust
   Chatterboxt   Boringt   GarrulousFilterc           B   s   e  Z d  Z d „  Z RS(   s)   A filter which blocks garrulous messages.c         C   s   | j  t k S(   N(   t   levelnot	   GARRULOUS(   R$   t   record(    (    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_logging.pyt   filter]  s    (   RH   RI   RJ   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_logging.pyR‰   Y  s   t   VerySpecificFilterc           B   s   e  Z d  Z d „  Z RS(   s5   A filter which blocks sociable and taciturn messages.c         C   s   | j  t t g k S(   N(   RŠ   t   SOCIABLEt   TACITURN(   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_logging.pyR�   d  s    (   RH   RI   RJ   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_logging.pyRŽ   `  s   t   CustomLevelsAndFiltersTestc           B   sA   e  Z d  Z d Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s@   Test various filtering possibilities with custom logging levels.s   ^[\w.]+ -> ([\w]+): ([\d]+)$c         C   s>   t  j |  ƒ x* t j ƒ  D] \ } } t j | | ƒ q Wd  S(   N(   R   R&   t   my_logging_levelst   itemsR   t   addLevelName(   R$   t   kt   v(    (    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_logging.pyR&   o  s    c         C   s+   x$ t  D] } | j | |  j ƒ  ƒ q Wd  S(   N(   t   LEVEL_RANGER_   RG   (   R$   t   loggert   lvl(    (    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_logging.pyt   log_at_all_levelst  s    c         C   sC   |  j  j t ƒ |  j |  j  ƒ |  j d d d d d d g ƒ d  S(   NR„   RW   Rƒ   RY   R‚   RZ   R�   R[   R€   R\   R   R]   (   R„   RW   (   Rƒ   RY   (   R‚   RZ   (   R�   R[   (   R€   R\   (   R   R]   (   R   R   t   VERBOSERš   RE   (   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_logging.pyt   test_logger_filterx  s    c         C   si   |  j  j d j t ƒ z0 |  j |  j  ƒ |  j d d d d d g ƒ Wd  |  j  j d j t j ƒ Xd  S(   Ni    Rƒ   RY   R‚   RZ   R�   R[   R€   R\   R   R]   (   Rƒ   RY   (   R‚   RZ   (   R�   R[   (   R€   R\   (   R   R]   (   R   R)   R   R�   Rš   RE   R   t   NOTSET(   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_logging.pyt   test_handler_filter†  s    c      
   C   së   |  j  j d } d  } t ƒ  } | j | ƒ z‘ |  j |  j  ƒ d d d d d d  d! d" d# g	 } |  j | ƒ t ƒ  } |  j  j | ƒ |  j |  j  ƒ |  j | d$ d% d& d' d( d) d* g ƒ Wd  | rÙ |  j  j | ƒ n  | j | ƒ Xd  S(+   Ni    Rˆ   RQ   R‡   RS   R…   RU   R„   RW   Rƒ   RY   R‚   RZ   R�   R[   R€   R\   R   R]   R^   t   12t   14t   15t   17t   18t   20(   Rˆ   RQ   (   R‡   RS   (   R…   RU   (   R„   RW   (   Rƒ   RY   (   R‚   RZ   (   R�   R[   (   R€   R\   (   R   R]   (   Rˆ   R^   (   R‡   RŸ   (   R…   R    (   R„   R¡   (   R‚   R¢   (   R�   R£   (   R   R¤   (	   R   R)   RK   R‰   Rw   Rš   RE   RŽ   Rx   (   R$   Rz   t   specific_filtert   garrt   first_lines(    (    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_logging.pyt   test_specific_filters–  s<    				(	   RH   RI   RJ   R0   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_logging.pyR‘   h  s   				t   MemoryHandlerTestc           B   s/   e  Z d  Z d Z d „  Z d „  Z d „  Z RS(   s   Tests for the MemoryHandler.s   ^[\w.]+ -> ([\w]+): ([\d]+)$c         C   sc   t  j |  ƒ t j j d t j |  j ƒ |  _ t j d ƒ |  _	 d |  j	 _
 |  j	 j |  j ƒ d  S(   Ni
   t   memi    (   R   R&   R   R)   t   MemoryHandlerRV   R   t   mem_hdlrR   t
   mem_loggert	   propagateR#   (   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_logging.pyR&   È  s    c         C   s   |  j  j ƒ  t j |  ƒ d  S(   N(   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_logging.pyR-   Ð  s    c         C   sC  |  j  j |  j ƒ  ƒ |  j g  ƒ |  j  j |  j ƒ  ƒ |  j g  ƒ |  j  j |  j ƒ  ƒ d d d g } |  j | ƒ x¡ d D]™ } x* t d	 ƒ D] } |  j  j |  j ƒ  ƒ q’ W|  j | ƒ |  j  j |  j ƒ  ƒ | g  t | | d
 ƒ D] } d t | ƒ f ^ qì } |  j | ƒ q W|  j  j |  j ƒ  ƒ |  j | ƒ d  S(   NR   RQ   RX   RS   RV   RT   i   i   i	   i
   (   R   RQ   (   RX   RS   (   RV   RT   (   i   i   (   R­   Rc   RG   RE   Rb   Ra   t   ranget   str(   R$   t   linest   nt   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_logging.pyt
   test_flushÔ  s$    	6(   RH   RI   RJ   R0   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_logging.pyR©   Á  s
   		t   ExceptionFormatterc           B   s   e  Z d  Z d „  Z RS(   s   A special exception formatter.c         C   s   d | d j  S(   Ns
   Got a [%s]i    (   RH   (   R$   t   ei(    (    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_logging.pyt   formatExceptionó  s    (   RH   RI   RJ   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_logging.pyRµ   ñ  s   t   ConfigFileTestc           B   sÙ   e  Z d  Z d Z d Z d Z d Z e j d d ƒ Z e j d d ƒ Z	 d	 e  d
 Z
 e j d d ƒ Z d Z d Z d Z d „  Z d „  Z e d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z RS(   s5   Reading logging config from a .ini-style config file.s   ^([\w]+) \+\+ ([\w]+)$sN  
    [loggers]
    keys=root

    [handlers]
    keys=hand1

    [formatters]
    keys=form1

    [logger_root]
    level=WARNING
    handlers=hand1

    [handler_hand1]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stdout,)

    [formatter_form1]
    format=%(levelname)s ++ %(message)s
    datefmt=
    sµ  
    [loggers]
    keys=root,parser

    [handlers]
    keys=hand1

    [formatters]
    keys=form1

    [logger_root]
    level=WARNING
    handlers=

    [logger_parser]
    level=DEBUG
    handlers=hand1
    propagate=1
    qualname=compiler.parser

    [handler_hand1]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stdout,)

    [formatter_form1]
    format=%(levelname)s ++ %(message)s
    datefmt=
    sµ  
    [loggers]
    keys=root,parser

    [handlers]
    keys=hand1

    [formatters]
    keys=form1

    [logger_root]
    level=WARNING
    handlers=hand1

    [logger_parser]
    level=DEBUG
    handlers=
    propagate=1
    qualname=compiler.parser

    [handler_hand1]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stdout,)

    [formatter_form1]
    format=%(levelname)s ++ %(message)s
    datefmt=
    s
   sys.stdouts
   sys.stbouts   formatter=form1s   formatter=misspelled_names  
    [loggers]
    keys=root

    [handlers]
    keys=hand1

    [formatters]
    keys=form1

    [logger_root]
    level=NOTSET
    handlers=hand1

    [handler_hand1]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stdout,)

    [formatter_form1]
    class=sS   .ExceptionFormatter
    format=%(levelname)s:%(name)s:%(message)s
    datefmt=
    s   class=StreamHandlers   class=logging.StreamHandlersg  
    [loggers]
    keys=root,parser

    [handlers]
    keys=hand1, hand2

    [formatters]
    keys=form1, form2

    [logger_root]
    level=WARNING
    handlers=

    [logger_parser]
    level=DEBUG
    handlers=hand1
    propagate=1
    qualname=compiler.parser

    [handler_hand1]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stdout,)

    [handler_hand2]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stderr,)

    [formatter_form1]
    format=%(levelname)s ++ %(message)s
    datefmt=

    [formatter_form2]
    format=%(message)s
    datefmt=
    s  
    [loggers]
    keys=root,parser,compiler

    [handlers]
    keys=hand1

    [formatters]
    keys=form1

    [logger_root]
    level=WARNING
    handlers=hand1

    [logger_compiler]
    level=DEBUG
    handlers=
    propagate=1
    qualname=compiler

    [logger_parser]
    level=DEBUG
    handlers=
    propagate=1
    qualname=compiler.parser

    [handler_hand1]
    class=StreamHandler
    level=NOTSET
    formatter=form1
    args=(sys.stdout,)

    [formatter_form1]
    format=%(levelname)s ++ %(message)s
    datefmt=
    sø   
    [loggers]
    keys=root

    [handlers]
    keys=screen

    [formatters]
    keys=

    [logger_root]
    level=DEBUG
    handlers=screen

    [handler_screen]
    level=DEBUG
    class=StreamHandler
    args=(sys.stdout,)
    formatter=
    c         K   s/   t  j t j | ƒ ƒ } t j j | | � d  S(   N(   R   R   t   textwrapt   dedentR   t   configt
   fileConfig(   R$   t   conft   kwargst   file(    (    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_logging.pyt   apply_configà  s    c         C   s{   t  ƒ  �l } |  j |  j ƒ t j ƒ  } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d g d | ƒ|  j g  ƒ Wd  QXd  S(   NRR   RS   R   (   RR   RS   (	   R   RÀ   t   config0R   R   Rb   RG   R`   RE   (   R$   t   outputR˜   (    (    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_logging.pyt   test_config0_okä  s    	c         C   s~   t  ƒ  �o } |  j | ƒ t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d d g d | ƒ|  j g  ƒ Wd  QXd  S(	   Ns   compiler.parserRX   RQ   RR   RS   R   (   RX   RQ   (   RR   RS   (   R   RÀ   R   R   Rb   RG   R`   RE   (   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_logging.pyt   test_config1_okó  s    	c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   t   StandardErrorRÀ   t   config2(   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_logging.pyt   test_config2_failure  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   RÅ   RÀ   t   config3(   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_logging.pyt   test_config3_failure  s    c      	   C   s“   t  ƒ  �„ } |  j |  j ƒ t j ƒ  } y t ƒ  ‚ Wn t k
 rU t j d ƒ n Xt j j	 d ƒ |  j
 | j ƒ  d ƒ |  j g  ƒ Wd  QXd  S(   Ns   just testingi    s-   ERROR:root:just testing
Got a [RuntimeError]
(   R   RÀ   t   config4R   R   t   RuntimeErrort	   exceptiont   syst   stdoutt   seekR6   R4   RE   (   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_logging.pyt   test_config4_ok
  s    c         C   s   |  j  d |  j ƒ d  S(   NR»   (   RÄ   t   config5(   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_logging.pyt   test_config5_ok  s    c         C   s   |  j  d |  j ƒ d  S(   NR»   (   RÄ   t   config6(   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_logging.pyt   test_config6_ok  s    c         C   s�  t  ƒ  �— } |  j |  j ƒ t j d ƒ } t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j	 d d d g d	 | ƒ|  j	 g  ƒ Wd  QXt  ƒ  �Ð } |  j |  j
 ƒ t j d ƒ } |  j | j ƒ | j |  j ƒ  ƒ | j |  j ƒ  ƒ t j d
 ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j	 d d d d g d	 | ƒ|  j	 g  ƒ Wd  QXd  S(   Ns   compiler.parsers   compiler-hyphenatedRX   RQ   RR   RS   RP   RT   R   s   compiler.lexerRU   RW   RY   RZ   (   RX   RQ   (   RR   RS   (   RP   RT   (   RX   RU   (   RR   RW   (   RX   RY   (   RR   RZ   (   R   RÀ   t   config1aR   R   Rb   RG   R`   t   criticalRE   t   config7t   assertFalset   disabled(   R$   RÂ   R˜   t
   hyphenated(    (    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_logging.pyt   test_config7_ok  s<    		c         C   sy   |  j  |  j ƒ t j d ƒ } |  j | j ƒ |  j  |  j ƒ |  j | j ƒ |  j  |  j d t ƒ|  j | j ƒ d  S(   Nt   foot   disable_existing_loggers(   RÀ   t   disable_testR   R   RØ   RÙ   t
   assertTruet   False(   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_logging.pyt   test_logger_disablingJ  s    (   RH   RI   RJ   R0   RÁ   t   config1RÕ   t   replaceRÆ   RÈ   RÊ   RÑ   RÓ   R×   RÞ   RÀ   RÃ   RÄ   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_logging.pyR¸   ÷  s.     *&								+t   LogRecordStreamHandlerc           B   s/   e  Z d  Z d Z d „  Z d „  Z d „  Z RS(   sq   Handler for a streaming logging request. It saves the log message in the
    TCP server's 'log_output' attribute.s	   !!!END!!!c         C   sÅ   x¾ t  rÀ |  j j d ƒ } t | ƒ d k  r1 Pn  t j d | ƒ d } |  j j | ƒ } x6 t | ƒ | k  r‘ | |  j j | t | ƒ ƒ } q\ W|  j | ƒ } t j | ƒ } |  j	 | ƒ q Wd S(   sÀ   Handle multiple requests - each expected to be of 4-byte length,
        followed by the LogRecord in pickle format. Logs the record
        according to whatever policy is configured locally.i   s   >Li    N(
   t   Truet
   connectiont   recvR7   t   structt   unpackt   unpickleR   t   makeLogRecordt   handle_log_record(   R$   t   chunkt   slent   objRŒ   (    (    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_logging.pyt   handleZ  s    	$c         C   s   t  j | ƒ S(   N(   t   cPicklet   loads(   R$   t   data(    (    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_logging.pyRê   j  s    c         C   s?   |  j  | j k r" d |  j _ d  S|  j j | j d 7_ d  S(   Ni   s   
(   t   TCP_LOG_ENDt   msgt   servert   abortt
   log_output(   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_logging.pyRì   m  s    (   RH   RI   RJ   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_logging.pyRä   S  s
   		t   LogRecordSocketReceiverc           B   s;   e  Z d  Z d Z d Z d e j j e d „ Z	 d „  Z
 RS(   sQ   A simple-minded TCP socket-based logging receiver suitable for test
    purposes.i   R   t	   localhostc         C   s>   t  j |  | | f | ƒ t |  _ d |  _ t j ƒ  |  _ d  S(   Ngš™™™™™¹?(   R    t   __init__Rà   R÷   t   timeoutt	   threadingt   Eventt   finished(   R$   t   hostt   portRz   (    (    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_logging.pyRû   ~  s    		c         C   sn   xP |  j  sR t j |  j j ƒ  g g  g  |  j ƒ \ } } } | r |  j ƒ  q q W|  j j ƒ  |  j ƒ  d  S(   N(	   R÷   t   selectt   sockett   filenoRü   t   handle_requestRÿ   t   sett   server_close(   R$   t   rdt   wrt   ex(    (    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_logging.pyt   serve_until_stopped†  s    (   RH   RI   RJ   t   allow_reuse_addressRø   R   R)   t   DEFAULT_TCP_LOGGING_PORTRä   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_logging.pyRù   v  s   	s!   Threading required for this test.t   SocketHandlerTestc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s   Test for SocketHandler objects.c         C   sÓ   t  j |  ƒ t d d ƒ |  _ |  j j j ƒ  d |  _ t j d |  j j	 ƒ g |  _
 x |  j
 D] } | j ƒ  q` Wt j j d |  j ƒ |  _ |  j j |  j ƒ |  j j |  j j d ƒ |  j j |  j ƒ d S(   st   Set up a TCP server to receive log messages, and a SocketHandler
        pointing to that server's address and port.R  i    i   t   targetRú   N(   R   R&   Rù   t	   tcpserverR  t   getsocknameR  Rý   t   ThreadR  t   threadst   startR   R)   t   SocketHandlert	   sock_hdlrR"   R!   R   R(   R#   (   R$   t   thread(    (    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_logging.pyR&   —  s    c         C   sl   zW t  |  j _ |  ` |  j j |  j ƒ |  j j ƒ  x |  j D] } | j d ƒ q? WWd t	 j
 |  ƒ Xd S(   s   Shutdown the TCP server.g       @N(   Rå   R  R÷   R   R(   R  R'   R  t   joinR   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_logging.pyR-   §  s    c         C   s0   |  j  j t j ƒ |  j j j d ƒ |  j j S(   s1   Get the log output as received by the TCP server.g       @(   R   RÖ   Rä   Rô   R  Rÿ   t   waitRø   (   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_logging.pyt
   get_output³  s    c         C   sC   t  j d ƒ } | j d ƒ | j d ƒ |  j |  j ƒ  d ƒ d  S(   Nt   tcpRu   t   eggss
   spam
eggs
(   R   R   R`   Rc   R6   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_logging.pyt   test_outputº  s    (   RH   RI   RJ   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_logging.pyR  ’  s
   			t
   MemoryTestc           B   s2   e  Z d  Z d „  Z d „  Z d „  Z d „  Z RS(   s*   Test memory persistence of logger objects.c         C   s   t  j |  ƒ i  |  _ d S(   s8   Create a dict to remember potentially destroyed objects.N(   R   R&   t
   _survivors(   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_logging.pyR&   Æ  s    c         G   sC   x< | D]4 } t  | ƒ t | ƒ f } t j | ƒ |  j | <q Wd S(   sK   Watch the given objects for survival, by creating weakrefs to
        them.N(   t   idt   reprt   weakreft   refR  (   R$   t   argsRï   t   key(    (    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_logging.pyt   _watch_for_survivalË  s    c         C   sˆ   t  j ƒ  g  } xB |  j j ƒ  D]1 \ \ } } } | ƒ  d k r  | j | ƒ q  q  W| r„ |  j d t | ƒ d j | ƒ f ƒ n  d S(   s;   Assert that all objects watched for survival have survived.s;   %d objects should have survived but have been destroyed: %ss   , N(	   t   gct   collectR  R“   RK   t   appendR:   R7   R  (   R$   t   deadt   id_t   repr_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_logging.pyt   _assertTruesurvivalÒ  s    
"	c         C   s¾   |  j  j t j ƒ t j d ƒ } |  j | ƒ | j t j ƒ |  j  j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j	 d g ƒ ~ |  j
 ƒ  t j d ƒ } | j |  j ƒ  ƒ |  j	 d d g ƒ d  S(   NRÜ   R   RS   RT   (   RÜ   R   RS   (   RÜ   R   RS   (   RÜ   R   RT   (   R   R   R   RX   R   R&  R   Rc   RG   RE   R-  (   R$   RÜ   t   bar(    (    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_logging.pyt   test_persistent_loggersÞ  s    

(   RH   RI   RJ   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_logging.pyR  Â  s
   			t   EncodingTestc           B   s#   e  Z d  „  Z d „  Z d „  Z RS(   c         C   sÔ   t  j d ƒ } t j d ƒ } d } z† t  j | ƒ } | j | ƒ z | j | ƒ Wd  | j | ƒ | j ƒ  Xt	 | ƒ } z  |  j
 | j ƒ  j ƒ  | ƒ Wd  | j ƒ  XWd  t j j | ƒ rÏ t j | ƒ n  Xd  S(   Nt   tests   .logs   foo€(   R   R   t   tempfilet   mktempt   FileHandlerR#   t   warningR(   R'   t   openR6   R=   t   rstript   ost   patht   isfilet   remove(   R$   R_   t   fnRó   Rz   t   f(    (    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_logging.pyt   test_encoding_plain_file÷  s      c         C   s°   t  j d ƒ } d } t j d ƒ } d | _ t j ƒ  } | | d ƒ } t  j | ƒ } | j | ƒ z | j	 | ƒ Wd  | j
 | ƒ | j ƒ  X| j ƒ  } |  j | d ƒ d  S(   NR1  u   Ð´Ð¾ Ñ�Ð²Ð¸Ð´Ð°Ð½Ð¸Ñ�t   cp1251t   stricts   äî ñâèäàíèÿ
(   R   R   t   codecst	   getwritert   encodingR   R   R   R#   R5  R(   R'   R4   R6   (   R$   R_   t   messaget   writer_classR   t   writerRz   RD   (    (    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_logging.pyt   test_encoding_cyrillic_unicode  s    	c         C   s°   t  j d ƒ } d } t j d ƒ } d | _ t j ƒ  } | | d ƒ } t  j | ƒ } | j | ƒ z | j	 | ƒ Wd  | j
 | ƒ | j ƒ  X| j ƒ  } |  j | d ƒ d  S(   NR1  u   bÅ‚Ä…ds	   utf-16-leR@  s
   b Bd 
 (   R   R   RA  RB  RC  R   R   R   R#   R5  R(   R'   R4   R6   (   R$   R_   RD  RE  R   RF  Rz   RD   (    (    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_logging.pyt   test_encoding_utf16_unicode%  s    	(   RH   RI   R>  RG  RH  (    (    (    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_logging.pyR0  ö  s   		t   WarningsTestc           B   s   e  Z d  „  Z RS(   c         C   s  t  j ƒ  �t j t ƒ zè t  j d d t ƒt j ƒ  } t j	 | ƒ } t j
 d ƒ } | j | ƒ t  j d ƒ | j | ƒ | j ƒ  } | j ƒ  |  j | j d ƒ d k ƒ t j ƒ  } t  j d t d d	 | d
 ƒ | j ƒ  } | j ƒ  |  j | d ƒ Wd  t j t ƒ XWd  QXd  S(   Nt   alwayst   categorys   py.warningss   I'm warning you...s    UserWarning: I'm warning you...
i    t   Explicits   dummy.pyi*   s
   Dummy lines0   dummy.py:42: UserWarning: Explicit
  Dummy line
(   t   warningst   catch_warningsR   t   captureWarningsRå   t   filterwarningst   UserWarningR   R   R   R   R#   Ra   R(   R4   R'   Rß   t   findt   showwarningR6   Rà   (   R$   R¿   R,   R˜   RD   (    (    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_logging.pyt   test_warnings:  s*    


	(   RH   RI   RT  (    (    (    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_logging.pyRI  8  s   c         C   s   t  j |  | ƒ S(   N(   R   R   (   t   formatt   datefmt(    (    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_logging.pyt
   formatFuncU  s    c           C   s
   t  j ƒ  S(   N(   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_logging.pyt   handlerFuncX  s    t   CustomHandlerc           B   s   e  Z RS(    (   RH   RI   (    (    (    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_logging.pyRY  [  s   t   ConfigDictTestc           B   s–
  e  Z d  Z d Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i d d 6d g d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z	 i d d 6i i e  d d 6d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i d d 6d g d 6d 6Z
 i d d 6i i e d 6d d 6d 6i e  d d 6d d 6d 6i e d 6d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6i e d 6d  6d 6i d d 6d g d 6d 6Z i d d 6i i d d 6d 6d 6i i e  d! d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i e  d! d	 6d d
 6d d 6d d 6d" d# 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d$ 6d 6i d d 6d 6Z i d d 6e d% 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d& 6i  d$ 6d 6i d d 6d 6Z i d d 6i i d d 6d 6d 6i i d d	 6d d
 6d d 6d d 6d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6e d' 6i i d d 6d 6d 6i i d( d 6d 6d 6Z i d d 6e d' 6i i d( d 6d 6d 6i i d( d 6d 6d 6Z i d d 6i i d d 6d 6d 6i i d d) 6d* 6d+ 6i i d d	 6d d
 6d d 6d d 6d* g d+ 6d 6d 6i i d d 6d* g d+ 6d 6d 6i d d 6d g d 6d 6Z i d d 6i i d d 6d 6d, 6i i d d	 6d d
 6d d 6d d 6d 6d- 6d. d 6i d/ d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i i i d d 6d 6d, 6i i d d	 6d d
 6d d 6d d 6d 6d- 6d. d 6i d/ d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d0 d 6i i d d 6d 6d, 6i i d d	 6d d
 6d d 6d d 6d 6d- 6d. d 6i d/ d 6d 6i i d d 6d g d 6d 6d 6i d d 6d 6Z i d d 6i i d1 d 6d2 6d 6i i d d	 6d d 6d2 d
 6d3 6i d4 d	 6d5 d6 6d2 d
 6d3 d7 6d d 6d8 6d 6i i d d 6d8 g d 6d9 d: 6d; 6d 6Z d< „  Z d= „  Z e d> „ Z d? „  Z  d@ „  Z! dA „  Z" dB „  Z# dC „  Z$ dD „  Z% dE „  Z& dF „  Z' dG „  Z( dH „  Z) dI „  Z* dJ „  Z+ dK „  Z, dL „  Z- dM „  Z. e/ j0 e1 dN ƒ dO „  ƒ Z2 dP „  Z3 dQ „  Z4 dR „  Z5 RS(S   s)   Reading logging config from a dictionary.s   ^([\w]+) \+\+ ([\w]+)$i   t   versions   %(levelname)s ++ %(message)sRU  t   form1t
   formatterss   logging.StreamHandlert   classt	   formatterR�   t   levels   ext://sys.stdoutR   t   hand1R)   RV   t   rootR   s   compiler.parsert   loggerss   ext://sys.stdboutt   NTOSETt   WRANINGt   misspelled_names   .ExceptionFormatters   ()s"   %(levelname)s:%(name)s:%(message)ss   .formatFunct   form2t   form3t   hand2s   .CustomHandlers   invalid parameter nameR\   s   compiler.lexerRÝ   t   compilert   incrementalRX   t   namet   filt1t   filterst   true_formatterst   handler_configss   cfg://true_formatterss   cfg://handler_configs[hand1]i   s1   %(asctime)s (%(name)s) %(levelname)s: %(message)st   mySimpleFormattert
   fileGlobals   logging.handlers.MemoryHandleri   t   capacityR  t   bufferGlobalt   trueR®   t   mymodulec         C   s   t  j j | ƒ d  S(   N(   R   R»   t
   dictConfig(   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_logging.pyRÀ   €  s    c         C   s{   t  ƒ  �l } |  j |  j ƒ t j ƒ  } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d g d | ƒ|  j g  ƒ Wd  QXd  S(   NRR   RS   R   (   RR   RS   (	   R   RÀ   RÁ   R   R   Rb   RG   R`   RE   (   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_logging.pyRÃ   ƒ  s    	c         C   s~   t  ƒ  �o } |  j | ƒ t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d d g d | ƒ|  j g  ƒ Wd  QXd  S(	   Ns   compiler.parserRX   RQ   RR   RS   R   (   RX   RQ   (   RR   RS   (   R   RÀ   R   R   Rb   RG   R`   RE   (   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_logging.pyRÄ   ’  s    	c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   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_logging.pyRÇ   ¡  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   RÅ   RÀ   t   config2a(   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_logging.pyt   test_config2a_failure¥  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   RÅ   RÀ   t   config2b(   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_logging.pyt   test_config2b_failure©  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   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_logging.pyRÉ   ­  s    c      	   C   s‡   t  ƒ  �x } |  j |  j ƒ y t ƒ  ‚ Wn t k
 rI t j d ƒ n Xt j j d ƒ |  j	 | j
 ƒ  d ƒ |  j g  ƒ Wd  QXd  S(   Ns   just testingi    s-   ERROR:root:just testing
Got a [RuntimeError]
(   R   RÀ   RÊ   RË   R   RÌ   RÍ   RÎ   RÏ   R6   R4   RE   (   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_logging.pyRÐ   ±  s    c      	   C   s‡   t  ƒ  �x } |  j |  j ƒ y t ƒ  ‚ Wn t k
 rI t j d ƒ n Xt j j d ƒ |  j	 | j
 ƒ  d ƒ |  j g  ƒ Wd  QXd  S(   Ns   just testingi    s-   ERROR:root:just testing
Got a [RuntimeError]
(   R   RÀ   t   config4aRË   R   RÌ   RÍ   RÎ   RÏ   R6   R4   RE   (   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_logging.pyt   test_config4a_okÀ  s    c         C   s   |  j  d |  j ƒ d  S(   NR»   (   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_logging.pyRÒ   Ï  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   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_logging.pyt   test_config6_failureÒ  s    c      	   C   s  t  ƒ  �r } |  j |  j ƒ t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d
 d g d | ƒ|  j g  ƒ Wd  QXt  ƒ  �‘ } |  j |  j	 ƒ t j d ƒ } |  j
 | j ƒ t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d d g d | ƒ|  j g  ƒ Wd  QXd  S(   Ns   compiler.parserRX   RQ   RR   RS   R   s   compiler.lexerRT   RU   (   RX   RQ   (   RR   RS   (   RX   RT   (   RR   RU   (   R   RÀ   Râ   R   R   Rb   RG   R`   RE   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_logging.pyRÛ   Õ  s,    		c         C   sI  t  ƒ  �r } |  j |  j ƒ t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d d g d | ƒ|  j g  ƒ Wd  QXt  ƒ  �½ } |  j |  j	 ƒ t j d ƒ } |  j
 | j ƒ | j |  j ƒ  ƒ | j |  j ƒ  ƒ t j d ƒ } | j |  j ƒ  ƒ | j |  j ƒ  ƒ |  j d d d d g d | ƒ|  j g  ƒ Wd  QXd  S(   Ns   compiler.parserRX   RQ   RR   RS   R   s   compiler.lexerRT   RU   RW   RY   (   RX   RQ   (   RR   RS   (   RX   RT   (   RR   RU   (   RX   RW   (   RR   RY   (   R   RÀ   Râ   R   R   Rb   RG   R`   RE   t   config8RØ   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_logging.pyt   test_config_8_okò  s4    		c         C   sÊ   t  ƒ  �» } |  j |  j ƒ t j d ƒ } | j |  j ƒ  ƒ |  j g  d | ƒ|  j |  j ƒ | j |  j ƒ  ƒ |  j g  d | ƒ|  j |  j	 ƒ | j |  j ƒ  ƒ |  j d g d | ƒWd  QXd  S(   Ns   compiler.parserR   RX   RT   (   RX   RT   (
   R   RÀ   t   config9R   R   Rb   RG   RE   t   config9at   config9b(   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_logging.pyt   test_config_9_ok  s    	c         C   sÇ   t  ƒ  �¸ } |  j |  j ƒ t j d ƒ } | j |  j ƒ  ƒ t j d ƒ } | j |  j ƒ  ƒ t j d ƒ } | j |  j ƒ  ƒ t j d ƒ } | j |  j ƒ  ƒ |  j d
 d g d	 | ƒWd  QXd  S(   Ns   compiler.parserRj  s   compiler.lexers   compiler.parser.codegenRV   RQ   RR   RU   R   (   RV   RQ   (   RR   RU   (	   R   RÀ   t   config10R   R   R5  RG   R`   RE   (   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_logging.pyt   test_config_10_ok%  s    	c         C   s   |  j  |  j ƒ d  S(   N(   RÄ   t   config11(   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_logging.pyt   test_config11_ok8  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   RÅ   RÀ   t   config12(   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_logging.pyt   test_config12_failure;  s    c         C   s   |  j  t |  j |  j ƒ d  S(   N(   Rp   RÅ   RÀ   t   config13(   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_logging.pyt   test_config13_failure>  s    s    listen() needs threading to workc   
      C   s%  t  j j d ƒ } | j ƒ  | j j ƒ  | j } | j j ƒ  z´ t j t j	 t j
 ƒ } | j d ƒ | j d | f ƒ t j d t | ƒ ƒ } | | } d } t | ƒ } x7 | d k rç | j | | ƒ }	 | |	 7} | |	 8} q± W| j ƒ  Wd  | j j d ƒ t  j j ƒ  | j d ƒ Xd  S(   Ni    g       @Rú   s   >L(   R   R»   t   listenR  t   readyR  R  R*   R  t   AF_INETt   SOCK_STREAMt
   settimeoutt   connectRè   t   packR7   t   sendR'   t   stopListeningR  (
   R$   t   textt   tR  t   sockRî   RD   t	   sentsofart   leftt   sent(    (    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_logging.pyt   setup_via_listenerA  s*    
	

c         C   sÐ   t  ƒ  �Á } |  j t j |  j ƒ ƒ t j d ƒ } | j |  j ƒ  ƒ t j d ƒ } | j |  j ƒ  ƒ t j d ƒ } | j |  j ƒ  ƒ t j d ƒ } | j	 |  j ƒ  ƒ |  j
 d
 d g d	 | ƒWd  QXd  S(   Ns   compiler.parserRj  s   compiler.lexers   compiler.parser.codegenRV   RQ   RR   RU   R   (   RV   RQ   (   RR   RU   (   R   Rœ  t   jsont   dumpsR…  R   R   R5  RG   R`   RE   (   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_logging.pyt   test_listen_config_10_ok]  s    	c         C   sŠ   t  ƒ  �{ } |  j t j t j ƒ ƒ t j d ƒ } | j |  j	 ƒ  ƒ | j
 |  j	 ƒ  ƒ |  j d d g d | ƒ|  j g  ƒ Wd  QXd  S(	   Ns   compiler.parserRX   RQ   RR   RS   R   (   RX   RQ   (   RR   RS   (   R   Rœ  R¹   Rº   R¸   Râ   R   R   Rb   RG   R`   RE   (   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_logging.pyt   test_listen_config_1_okp  s    	c         C   s@   |  j  |  j ƒ t j d ƒ j d } |  j | j t j ƒ d  S(   NRv  i    (   RÀ   t   out_of_orderR   R   R)   t   assertIsInstanceR  t   Handler(   R$   Rz   (    (    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_logging.pyt   test_out_of_order~  s    (6   RH   RI   RJ   R0   RÁ   Râ   RÆ   Rx  Rz  RÈ   RÊ   Rµ   RW  RX  R|  RÑ   RÓ   R×   Rà   R  R�  Rå   R‚  Rƒ  R…  R‡  R‰  R‹  R¡  RÀ   RÃ   RÄ   RÇ   Ry  R{  RÉ   RÐ   R}  RÒ   R~  RÛ   R€  R„  R†  Rˆ  RŠ  RŒ  t   unittestt
   skipUnlessRý   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_logging.pyRZ  ^  sâ  
												!							t   ManagerTestc           B   s   e  Z d  „  Z RS(   c            s—   g  ‰  d t  j f ‡  f d †  ƒ  Y} t  j d  ƒ } |  j t | j t ƒ | j | ƒ | j d ƒ } | j	 d ƒ t  j	 d ƒ |  j
 ˆ  d g ƒ d  S(   Nt   MyLoggerc              s   e  Z d d ‡  f d  † Z RS(   c            s   ˆ  j  | ƒ d  S(   N(   R)  (   R$   R`  Rõ   R$  t   exc_infot   extra(   t   logged(    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_logging.pyt   _logˆ  s    N(   RH   RI   RK   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_logging.pyR¨  ‡  s   R1  s   should appear in loggeds   should not appear in logged(   R   t   Loggert   ManagerRK   Rp   Rq   t   setLoggerClasst   intR   R5  R6   (   R$   R¨  t   manR˜   (    (   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_logging.pyt   test_manager_loggerclass„  s    (   RH   RI   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_logging.pyR§  ƒ  s   t   ChildLoggerTestc           B   s   e  Z d  „  Z RS(   c         C   sü   t  j ƒ  } t  j d ƒ } t  j d ƒ } | j d ƒ } | j d ƒ } |  j | t  j d ƒ k ƒ |  j | t  j d ƒ k ƒ | j d ƒ } | j d ƒ } | j d ƒ } |  j | t  j d ƒ k ƒ |  j | t  j d ƒ k ƒ |  j | | k ƒ d  S(	   Nt   abcs   def.ghit   xyzs   uvw.xyzt   deft   ghis   abc.defs   abc.def.ghi(   R   R   t   getChildRß   (   R$   t   rt   l1t   l2t   c1t   c2t   c3(    (    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_logging.pyt   test_child_loggers–  s    (   RH   RI   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_logging.pyR³  •  s   t   HandlerTestc           B   s>   e  Z e j e j d  k d ƒ e j e d ƒ d „  ƒ ƒ Z RS(   t   nts/   WatchedFileHandler not appropriate for Windows.s!   Threading required for this test.c      	   C   sW  d „  } d } d } x;t  t f D]-} t j d d ƒ \ } } t j | ƒ t j d | d | | f ƒ } t | _ | j	 ƒ  t
 j j | d | ƒ} t
 j d ƒ }	 | j |	 ƒ zK xD t | ƒ D]6 }
 t j d	 ƒ t
 j i d
 d 6ƒ } | j | ƒ qÂ WWd  | j ƒ  y | j ƒ  Wn t k
 r+n Xt j j | ƒ rNt j | ƒ n  Xq" Wd  S(   Nc         S   s]   xV t  | ƒ D]H } y t j |  ƒ Wn t k
 r7 n Xt j d t j d d ƒ ƒ q Wd  S(   Ngü©ñÒMbp?i    i   (   R¯   R8  t   unlinkt   OSErrort   timet   sleept   randomt   randint(   t   fnamet   triest   _(    (    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_logging.pyt   remove_loop¬  s    iô  s   .logs   test_logging-3-R  R$  t   delays'   %(asctime)s: %(levelname)s: %(message)sg{®Gázt?t   testingRõ   (   Rà   Rå   R2  t   mkstempR8  R'   Rý   R  t   daemonR  R   R)   t   WatchedFileHandlerR   R"   R¯   RÄ  RÅ  Rë   Rð   R  t
   ValueErrorR9  t   existsRÂ  (   R$   RË  t	   del_countt	   log_countRÌ  t   fdR<  t   removerR,   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_logging.pyt	   test_race¨  s0    		

(	   RH   RI   R¥  t   skipIfR8  Rl  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_logging.pyRÀ  ¦  s   t   LC_ALLR   c           C   s2   t  t t t t t t t t t	 t
 t t t ƒ d  S(   N(   R   RL   Rt   R‘   R©   R¸   R  R  R0  RI  RZ  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_logging.pyt	   test_mainÒ  s
    		t   __main__(J   RJ   R   t   logging.handlerst   logging.configRA  Rñ   R   R'  R�  R8  RÆ  R.   R  R  t   SocketServerR    R   Rè   RÍ   R2  t   test.test_supportR   R   R   R¹   RÄ  R¥  RM  R"  Rý   t   ImportErrorRK   t   TestCaseR   RL   Rt   t   SILENTR�   t   TERSEt   EFFUSIVER�   R›   t	   TALKATIVER‹   t
   CHATTERBOXt   BORINGR¯   R—   R’   Rv   R‰   RŽ   R‘   R©   R   Rµ   R¸   Rä   Rù   R¦  R  R  R0  RI  RW  RX  R   RY  RZ  R§  R³  RÀ  RÚ  RH   (    (    (    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_logging.pyt   <module>   sž   
Z‰%
Y0ÿ ]#/4B	ÿ ÿ ÿ (,