Search code examples
pythoncode-coveragejython

Jython test coverage


I'm trying to use Jython instead of Python for a project (want jdbc driver for a sort of rare database). Everything is working OK so far, but I can't find any good tools for code coverage. Does anyone have a solution to this?

The googling I've done seems to indicate that jython is missing some things that code coverage tools need. http://nedbatchelder.com/blog/201005/coveragepy_on_jython.html

How do others solve this? I suppose something like jpype together with normal python would be a way forward, but I would rather not introduce jpype in my environment just for coverage measurements.


Solution

  • The blog post you link mentions that you can run "coverage run" under Jython, then "coverage html" under CPython. Did you try this? It should give reasonable results.