title: How to use pytest to check that Error is NOT raised
body: <p>Let's assume we have smth like that :</p>
  
  <pre><code>import py, pytest
  
  ERROR1 = ' --- Error : value &lt; 5! ---'
  ERROR2 = ' --- Error : value &gt; 10! ---'
  
  class MyError(Exception):
      def __init__(self, m):
          self.m = m
  
      def __str__(self):
          return self.m
  
  def foo(i):
      if i &lt; 5:
          raise MyError(ERROR1)
      elif i &gt; 10:
          raise MyError(ERROR2)
      return i
  
  
  # ---------------------- TESTS -------------------------
  def test_foo1():
      with pytest.raises(MyError) as e:
          foo(3)
      assert ERROR1 in str(e)
  
  def test_foo2():
      with pytest.raises(MyError) as e:
          foo(11)
      assert ERROR2 in str(e)
  
  def test_foo3():
          ....
          foo(7)
           ....
  </code></pre>
  
  <p>Q: How can I make test_foo3() to test, that no MyError is raised?
  It's obvious, that i could just test :</p>
  
  <pre><code>def test_foo3():
      assert foo(7) == 7
  </code></pre>
  
  <p>but i want to test that via pytest.raises(). Is is possible someway?
  For example: in a case, that function "foo" has no return-value at all,</p>
  
  <pre><code>def foo(i):
      if i &lt; 5:
          raise MyError(ERROR1)
      elif i &gt; 10:
          raise MyError(ERROR2)
  </code></pre>
  
  <p>it could make sense to test this way, imho.</p>