[TIP] coverage.py and appengine
Ivo Bellin Salarin
ivo.bellinsalarin at gmail.com
Tue Feb 7 06:32:16 PST 2017
has someone on this list been using coverage.py to collect code coverage on
appengine applications, recently?
I have been successful in collecting it, in an intrusive manner, hacking
sandbox.py and stubs.py (because, in such environment, an application
hasn't the right to write to the disk). Intrusive also means "modifying the
code of the running application in order to call CodeCoverage API". My
modifications occasionally generate concurrency errors (because of a
failing assert in Collector.stop(), lines 306 and 307). These are the
reasons for which I am not satisfied about this way of collecting CC.
I have also tried to collect the code coverage in a non intrusive way
(read: setting the COVERAGE_PROCESS_START environment variable and
preparing an ad-hoc pth file that gets loaded during python processes
startup). But in this case I collect *nothing* (apart from 5 statements out
of 6 in /etc/python/sitecustomize.py). Perhaps because each appengine
request is being processed in a particular environment where environment
variables have a special meaning (and as such, the calling process
environment variables have vanished).
So, before abandoning the quest, I am searching for ideas or previously
Just in case, I try to get CC on Ubuntu 16.04 and MacOS, using python 2.7
(a standard appengine environment).
Many thanks in advance,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the testing-in-python