I’m undertaking a significant overhaul of coverage.py, my Python code coverage measurement tool. The first release of it is ready: coverage.py v3.0b1. Changes include:
- Coverage.py is now a package rather than a module. The name is now a bit of a misnomer, since there is no longer a file named coverage.py. Functionality has been split into classes.
- The trace function is implemented in C for speed.
- Executable lines are identified by reading the line number tables in the compiled code, removing a great deal of complicated analysis code.
- The singleton coverage object is only created if the module-level functions are used. This maintains the old interface while allowing better programmatic use of coverage.py.
- The minimum supported Python version is 2.3. Python 3.0 is not supported.
- Precisely which lines are considered executable has changed in some cases. Therefore, your coverage stats may also change slightly compared to earlier versions of coverage.py.
As you can see, very little has changed functionally since v2.85. So far this is a refactoring, reimplementation, and repackaging effort. The new code will be a much better foundation for more interesting changes in the future. This beta 1 release is so I can find out if I’ve screwed up anything so far or not.
You can download the kit in one of two ways: