[TIP] Can coverage.py be used to collect coverage data for Functional or integration tests?
me at the-compiler.org
Thu Mar 2 01:07:32 PST 2017
* Rachit Sinha <rachit.sinha at nutanix.com> [2017-03-02 08:55:08 +0000]:
> Coming to your 1st Question. Coverage.py can run as an external
> agent which gets attached to the process for which coverage data is
> to be gathered.
Only if Python provides a way to do that - which to my knowledge, it
(You *could* probably attach via gdb and use that to trace what Python
code is being executed - but it's going to be painful and horribly
> Can coverage.py work with an external framework? Our company has its own command line tests framework.
> So can coverage.py be integrated with it?
> If so, can you or anyone share with me the procedure for the same?
coverage.py doesn't care what test framework you're using. Think of it
as a wrapper around a Python process - you can also just do:
coverage run python foo.py
without any test framework involved.
So either just run your entire test framework under coverage, or do
something like what pytest-cov does:
(alternatively, stop using your own test framework and extend
something more common instead :P)
http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP)
GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc
I love long mails! | http://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 833 bytes
Desc: not available
More information about the testing-in-python