
    |j                     L    d dl Zd dlmc mZ d dlZd dlmZ d Z	d Z
d Zd ZdS )    N)
bounded_ioc                     t           j        } d } | |          }d}||k    }|st          j        d|fd||f          dt	          j                    v st          j        t                     rt          j        t                     ndt          j        |           t          j        |          t          j        |          t          j        |          dz  }dd|iz  }t          t          j	        |                    d x} x}x}x}}d S )	Nc                      dS )N*    r       DC:\Users\jvoigtlander\Desktop\BubbleCamCode\tests\test_bounded_io.py<lambda>z.test_returns_value_when_fast.<locals>.<lambda>   s    r r   r   ==)zV%(py6)s
{%(py6)s = %(py2)s
{%(py2)s = %(py0)s.run_with_timeout
}(%(py4)s)
} == %(py9)sr   )py0py2py4py6py9assert %(py11)spy11
r   run_with_timeout
@pytest_ar_call_reprcompare@py_builtinslocals_should_repr_global_name	_safereprAssertionError_format_explanation)@py_assert1@py_assert3@py_assert5@py_assert8@py_assert7@py_format10@py_format12s          r	   test_returns_value_when_fastr%      s*   &8zz8&&z228b82b88888888882b888888888888:88888:888888&8888z888828888b888888888888888888888888888888888r   c                     t          j        d dd          } d}| |k    }|st          j        d|fd| |f          dt	          j                    v st          j        |           rt          j        |           ndt          j        |          dz  }d	d
|iz  }t          t          j	        |                    d x}}d S )Nc                  *    t          j        d          S )N   timesleepr   r   r	   r
   z1test_returns_default_on_timeout.<locals>.<lambda>   s    A r   g?zgave-uptimeoutdefaultr   )z%(py0)s == %(py3)sresult)r   py3zassert %(py5)spy5r   )r/   @py_assert2r   @py_format4@py_format6s        r	   test_returns_default_on_timeoutr5   
   s     ()>)>U^___F6Y6Y66Yr   c            	         d } t           j        }d} || |          }d}||k    }|st          j        d|fd||f          dt	          j                    v st          j        t                     rt          j        t                     ndt          j        |          dt	          j                    v st          j        |           rt          j        |           ndt          j        |          t          j        |          t          j        |          dz  }d	d
|iz  }t          t          j	        |                    d x}x}x}x}}d S )Nc                       t          d          )Nzdevice not responding)OSErrorr   r   r	   boomz/test_returns_default_on_exception.<locals>.boom   s    -...r   r   )r.   r   )zh%(py7)s
{%(py7)s = %(py2)s
{%(py2)s = %(py0)s.run_with_timeout
}(%(py3)s, default=%(py5)s)
} == %(py10)sr   r9   )r   r   r0   r1   py7py10zassert %(py12)spy12r   )r9   r   @py_assert4@py_assert6@py_assert9r!   @py_format11@py_format13s           r	   !test_returns_default_on_exceptionrB      sx   / / / &<Q<&&tQ777<1<71<<<<<<<<<<71<<<<<<<<<<<<:<<<<<:<<<<<<&<<<<<<<<<<<t<<<<<t<<<<<<Q<<<<7<<<<1<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<r   c                     t          j                    } t          j        d dd            t           j        } |            }|| z
  }d}||k     }|st	          j        d|fd||f          dt          j                    v st	          j        t                     rt	          j	        t                     ndt	          j	        |          t	          j	        |          dt          j                    v st	          j        |           rt	          j	        |           ndt	          j	        |          d	z  }d
d|iz  }t          t	          j        |                    d x}x}x}x}}d S )Nc                  *    t          j        d          S )N
   r)   r   r   r	   r
   z9test_does_not_block_caller_past_timeout.<locals>.<lambda>   s    
2 r   g?r,   g      @)<)zS(%(py4)s
{%(py4)s = %(py2)s
{%(py2)s = %(py0)s.monotonic
}()
} - %(py5)s) < %(py9)sr*   started)r   r   r   r1   r   r   r   )r*   	monotonicr   r   r   r   r   r   r   r   r   r   )rG   r   r   r>   r!   r"   r#   r$   s           r	   'test_does_not_block_caller_past_timeoutrI      s}   nG 6 6TRRRR>+>>+g%++%++++++++++%++++++++++++4+++++4++++++>+++++++++++++++g+++++g+++++++++++++++++++++++++++++++++++++++r   )builtinsr   _pytest.assertion.rewrite	assertionrewriter   r*   	bubblecamr   r%   r5   rB   rI   r   r   r	   <module>rO      s                             9 9 9  = = =, , , , ,r   