3
½ìœ]L  ã               @   sD   d Z ddlmZ ddlZddlZddlmZmZ G dd„ deƒZdS )z!
    Tests the h5py.File object.
é    )Úabsolute_importNé   )ÚutÚTestCasec               @   s    e Zd ZdZdd„ Zdd„ ZdS )ÚTestErrorPrintingzC
        Verify the error printing is squashed in all threads.
    c                s4   ddl }‡ fdd„}|j|d�}|jƒ  |jƒ  dS )z; No console messages should be shown from membership tests r   Nc                 sD   t jˆ jƒ dƒ�*} y| d j}W n tk
r4   Y nX W d Q R X d S )NÚwÚdoesnt_exist)Úh5pyÚFileÚmktempÚvalueÚKeyError)Únewfiler   )Úself© ú7/tmp/pip-build-pcqn41bp/h5py/h5py/tests/test_threads.pyÚtest$   s
    z-TestErrorPrinting.test_printing.<locals>.test)Útarget)Ú	threadingÚThreadÚstartÚjoin)r   r   r   Úthr   )r   r   Útest_printing   s
    zTestErrorPrinting.test_printingc                s,   ‡ fdd„}t j|d�}|jƒ  |jƒ  dS )zA No console messages should be shown for non-existing attributes c                 sV   t jˆ jƒ dƒ�<} dddg| d< y| d jd }W n tk
rF   Y nX W d Q R X d S )Nr   r   é   é   ÚnewdataÚnonexistent_attr)r	   r
   r   Úattrsr   )r   r   )r   r   r   r   2   s    z2TestErrorPrinting.test_attr_printing.<locals>.test)r   N)r   r   r   r   )r   r   r   r   )r   r   Útest_attr_printing/   s    	z$TestErrorPrinting.test_attr_printingN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r   r      s   r   )	r#   Ú
__future__r   r   r	   Úcommonr   r   r   r   r   r   r   Ú<module>   s
   