title: Wrong coverage report with WebTest
body: <p>I have a pyramid application that I am testing using WebTest with the following code:</p>
  
  <pre><code>class FunctionalTests(unittest.TestCase):
      def setUp(self):
          from test_app import main        
          app = main({})
          from webtest import TestApp
  
          self.testapp = TestApp(app)
  
  
      def test_not_found(self):
          self.testapp.get("/not_found", status=404)
  </code></pre>
  
  <p>The view for not found is defined as follow:</p>
  
  <pre><code>@notfound_view_config(renderer="../templates/404.jinja2")
  def notfound_view(request):
      request.response.status = 404 # This is line 6
      return {}  # This is line 7
  </code></pre>
  
  <p>The coverage for the no found view is:</p>
  
  <pre><code> Name                                                    Stmts   Miss Branch BrPart  Cover   Missing
    test_app/views/notfound.py                                 4      2      0      0    50%   6-7
  </code></pre>
  
  <p>But there is no way that those line were skipped in the test so why coverage missed them?</p>
  
  <p>This is my .coveragerc</p>
  
  <pre><code>[run]
  branch = True
  source = test_app
  # omit = bad_file.py
  
  [paths]
  source =
      test_app/
      */site-packages/
  
  [report]
  show_missing = True
  </code></pre>
  
  <p>I run the test with:</p>
  
  <pre><code>pytest --cov=formshare
  </code></pre>