
    1Vh                     0    d Z ddlZddlZd Zd Zd Zd Zy)z!
    Tests the h5py.File object.
    Nc                     t        j                  | d      5 }	 |d   j                  }ddd       y# t        $ r Y w xY w# 1 sw Y   yxY w)z)Create a file and access not existing keywdoesnt_existN)h5pyFilevalueKeyError)filenamenewfiler   s      F/home/dcms/DCMS/lib/python3.12/site-packages/h5py/tests/test_errors.py_access_not_existing_objectr      sU    	8S	! W	">288L   		 s!   A 1	=A =A  A	c                    | dz  }	 t         j                  j                          t        |       |j	                         }|j
                  dk7  sJ |j                  dk(  sJ 	 t         j                  j                          t        |       |j	                         }|j
                  dk(  sJ |j                  dk(  sJ y# t         j                  j                          w xY w)z5Check that HDF5 errors can be muted/unmuted from h5pytest.h5 N)r   _errorsunsilence_errorsr   
readouterrerroutsilence_errors)tmp_pathcapfdr
   captureds       r   test_unsilence_errorsr      s    )#H
&%%'#H-##%||r!!!||r!!! 	##%)!H<<2<<2 	##%s   AB? ? Cc                     t        j                  t        | dz  f      }|j                          |j	                          |j                         }|j                  dk(  sJ |j                  dk(  sJ y)zyVerify the error printing is squashed in all threads.

    No console messages should be shown from membership tests
    r   )targetargsr   N)	threadingThreadr   startjoinr   r   r   )r   r   thr   s       r   )test_thread_hdf5_silence_error_membershipr#   2   sf    
 
		!< (9 46
8BHHJGGI!H<<2<<2    c                       fd}t        j                  |      }|j                          |j                          |j	                         }|j
                  dk(  sJ |j                  dk(  sJ y)zVerify the error printing is squashed in all threads.

    No console messages should be shown for non-existing attributes
    c                      t        j                  dz  d      5 } g d| d<   	 | d   j                  d   }d d d        y # t        $ r Y w xY w# 1 sw Y   y xY w)Nr   r   )         newdatanonexistent_attr)r   r   attrsr	   )r   r+   r   s     r   testz1test_thread_hdf5_silence_error_attr.<locals>.testF   sl    YYx	)3/ 	7!*GI#*9#5#;#;<N#O 	 	  		 	s&   A?	AA
AAA)r   r   N)r   r   r    r!   r   r   r   )r   r   r-   r"   r   s   `    r   #test_thread_hdf5_silence_error_attrr.   A   s^    
 
			&BHHJGGI!H<<2<<2r$   )__doc__r   r   r   r   r#   r.    r$   r   <module>r1      s&     .r$   