title: unittest - how to assert if the two possibly NaN values are equal
body: <p>In my test case, I assume that if two values are <code>NaN</code> then they are equal. What is the way to express it using <code>unittest</code> assertions? The two common functions presented below are not handling this case.</p>
  
  <pre><code>v1 = np.nan
  v2 = np.nan
  self.assertEquals(v1, v2)
  self.assertTrue(v1 == v2)
  </code></pre>
  
  <p>A solution that is working for me right now is using a boolean expression inside <code>assertTrue</code>:</p>
  
  <pre><code>self.assertTrue(v1 == v2 or (np.isnan(v1) and np.isnan(v2))
  </code></pre>