Need help for setting up coverage on the flask/mod wsgi environment

Issue #457 closed
Surajit created an issue

Hi,

First of all, this is not a bug. Just wanted to ask how do I configure Coverage. I have a flask based application, where GET/POST apis are implemented in python code. I need to find the coverage for the requests coming for the APIs. Pls note that I dont have any test code written in Py, instead written in Java.

I want to make sure coverage should be started when the apache server is started and stopped once we stop the apache server. Within the time, I want to see how much coverage has been collected from the API hits.

Coverage apis says coverage.start() execute test cases coverage.stop() and then save().

Is it possible to achieve with Subprocess coverage ? Any pointers pls. Tried calling the start/stop from a wsgi script file. I tried to even expose start and stop coverage from API requests, but that didnt help me saving data.

Comments (2)

  1. Ned Batchelder repo owner

    You should be able to modify your wsgi file to invoke coverage. If it isn't working, paste it here, and we can take a look.

    I'll close the issue, but feel free to keep the discussion going.

  2. Log in to comment