Code Coverage support for unittest? 
Author Message
 Code Coverage support for unittest?

I was reading this:

http://www.*-*-*.com/ #SECTION000800000000...

and the author referred to using a modified version of Skip Montanaro's
trace.py to get CODE COVERAGE reporting for unit tests written using the
unittest module.

Really? How? I must have missed this in the docs! It sounds great...
does anyone know the details, or where (if at all) it's documented?

-- Michael Chermside



Sun, 07 Mar 2004 23:42:09 GMT  
 Code Coverage support for unittest?

Quote:

> I was reading this:

> http://www.amk.ca/python/writing/mx-architecture/#SECTION000800000000...

> and the author referred to using a modified version of Skip Montanaro's
> trace.py to get CODE COVERAGE reporting for unit tests written using the
> unittest module.

> Really? How? I must have missed this in the docs! It sounds great...
> does anyone know the details, or where (if at all) it's documented?

The unittest included with Quixote is not that same as the one released
with 2.1.

  Neil



Mon, 08 Mar 2004 00:41:02 GMT  
 Code Coverage support for unittest?


Quote:
> I was reading this:

http://www.*-*-*.com/ #SECTION000800000000...
00

Quote:

> and the author referred to using a modified version of Skip Montanaro's
> trace.py to get CODE COVERAGE reporting for unit tests written using the
> unittest module.

> Really? How? I must have missed this in the docs! It sounds great...
> does anyone know the details, or where (if at all) it's documented?

> -- Michael Chermside

I did it a couple of months ago, and I don't remember the details,
except that it wasn't very hard. I just ran the unit test script under the
code coverage module. Granted, then it also did code coverage for
unittest, but I can live with that.

The first problem I had was that I couldn't unzip the thing under
Windows! Eventually, I got real creative with a combination of PKZip
and wordpad, and managed to get it out, but it wasn't pretty.

The second problem was (and is) that it isn't integrated into the
unit test framework. It needs a lot more work to be able to simply
run it and then get a simple "OK" (meaning 100% code coverage),
or a report on what wasn't covered.

In addition, there are a lot of holes in the actual coverage itself.
Some of these are in the analyzer / reporter, and could be fixed,
but some of them are in the structure of the debugging support
in Python, and would require changes to the de{*filter*} interface to
the interpreter to fix. This includes coverage tests of "short-circuit"
operators - there doesn't seem to be any way of telling
what parts of the expression were actually executed.

John Roth



Tue, 09 Mar 2004 06:15:09 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Seeking beta sites for testing code coverage product

2. Smalltalk Test Kritic (Code coverage tool)

3. ANNOUNCE- Fast code coverage tool

4. Code coverage in Ruby?

5. code coverage tool?

6. set_trace_func and code coverage

7. Code Coverage Tool

8. code coverage tool

9. Verilog Code coverage tools......

10. Code Coverage on Schematic Entry Blocks

11. code coverage analysis

12. code coverage

 

 
Powered by phpBB® Forum Software