title: pytest: assert almost equal
body: <p>How to do <code>assert almost equal</code> with py.test for floats without resorting to something like:</p>
  
  <pre><code>assert x - 0.00001 &lt;= y &lt;= x + 0.00001
  </code></pre>
  
  <p>More specifically it will be useful to know a neat solution for quickly compare pairs of float, without unpacking them:</p>
  
  <pre><code>assert (1.32, 2.4) == i_return_tuple_of_two_floats()
  </code></pre>