Version 3.5b1 — 2011-06-05
- The HTML report now has hotkeys. Try
n
,s
,m
,x
,b
,p
, andc
on the overview page to change the column sorting. On a file page,r
,m
,x
, andp
toggle the run, missing, excluded, and partial line markings. You can navigate the highlighted sections of code by using thej
andk
keys for next and previous. The1
(one) key jumps to the first highlighted section in the file, and0
(zero) scrolls to the top of the file. - The
--omit
and--include
switches now interpret their values more usefully. If the value starts with a wildcard character, it is used as-is. If it does not, it is interpreted relative to the current directory. Closes issue 121. - Partial branch warnings can now be pragma’d away. The configuration option
partial_branches
is a list of regular expressions. Lines matching any of those expressions will never be marked as a partial branch. In addition, there’s a built-in list of regular expressions marking statements which should never be marked as partial. This list includeswhile True:
,while 1:
,if 1:
, andif 0:
. - The
coverage()
constructor accepts single strings for theomit=
andinclude=
arguments, adapting to a common error in programmatic use. - Modules can now be run directly using
coverage run -m modulename
, to mirror Python’s-m
flag. Closes issue 95, thanks, Brandon Rhodes. coverage run
didn’t emulate Python accurately in one small detail: the current directory inserted intosys.path
was relative rather than absolute. This is now fixed.- HTML reporting is now incremental: a record is kept of the data that produced the HTML reports, and only files whose data has changed will be generated. This should make most HTML reporting faster.
- Pathological code execution could disable the trace function behind our backs, leading to incorrect code measurement. Now if this happens, coverage.py will issue a warning, at least alerting you to the problem. Closes issue 93. Thanks to Marius Gedminas for the idea.
- The C-based trace function now behaves properly when saved and restored with
sys.gettrace()
andsys.settrace()
. This fixes issue 125 and issue 123. Thanks, Devin Jeanpierre. - Source files are now opened with Python 3.2’s
tokenize.open()
where possible, to get the best handling of Python source files with encodings. Closes issue 107, thanks, Brett Cannon. - Syntax errors in supposed Python files can now be ignored during reporting with the
-i
switch just like other source errors. Closes issue 115. - Installation from source now succeeds on machines without a C compiler, closing issue 80.
- Coverage.py can now be run directly from a working tree by specifying the directory name to python:
python coverage_py_working_dir run ...
. Thanks, Brett Cannon. - A little bit of Jython support: coverage run can now measure Jython execution by adapting when $py.class files are traced. Thanks, Adi Roiban. Jython still doesn’t provide the Python libraries needed to make coverage reporting work, unfortunately.
- Internally, files are now closed explicitly, fixing issue 104. Thanks, Brett Cannon.
➡️ PyPI page: coverage 3.5b1.
➡️ To install: python3 -m pip install coverage==3.5b1