B
    Mô`¯  ã               @   st   d dl Z d dlZd dlZd dlZd dlZejje jdkdd�ejje jdkoVe  ¡ d kdd�dd„ ƒƒZ	dd	„ Z
dS )
é    NÚntz%chmod() doesn't work as is on Windows)Úreasonzchmod() doesn't work as rootc          
   C   sj   t  | ¡j}zJt  | d¡ tjtjddgt jdt	| ƒi–tj
ddd�}d|jksTt‚W dt  | |¡ X dS )	zETest that a warning is emitted if a temporary configdir must be used.r   z-czimport matplotlibZMPLCONFIGDIRT)ÚenvÚstderrÚuniversal_newlinesÚcheckzset the MPLCONFIGDIRN)ÚosÚstatÚst_modeÚchmodÚ
subprocessÚrunÚsysÚ
executableÚenvironÚstrÚPIPEr   ÚAssertionError)ZtmpdirÚmodeÚproc© r   úD/tmp/pip-unpacked-wheel-0c1wfn4v/matplotlib/tests/test_matplotlib.pyÚtest_tmpconfigdir_warning
   s    
r   c              C   sD   dd„ } t | dƒƒt tjjƒks$t‚t | dƒƒt tjjƒks@t‚dS )zƒ
    Test that the standard backends mentioned in the docstring of
    matplotlib.use() are the same as in matplotlib.rcsetup.
    c             S   sL   g }xBt jj | ¡d  d¡D ]&}| ¡ s,P |dd„ | d¡D ƒ7 }qW |S )Né   Ú
c             S   s   g | ]}|r|  ¡ ‘qS r   )Ústrip)Ú.0Úer   r   r   ú
<listcomp>&   s    zAtest_use_doc_standard_backends.<locals>.parse.<locals>.<listcomp>ú,)Ú
matplotlibZuseÚ__doc__Úsplitr   )ÚkeyÚbackendsÚliner   r   r   Úparse!   s    z-test_use_doc_standard_backends.<locals>.parsez- interactive backends:
z- non-interactive backends:
N)Úsetr    ZrcsetupZinteractive_bkr   Znon_interactive_bk)r&   r   r   r   Útest_use_doc_standard_backends   s
    

r(   )r   r   r   Zpytestr    ÚmarkZskipifÚnameÚgeteuidr   r(   r   r   r   r   Ú<module>   s   