# eric3.DebugClients.Python.PyCoverage

Module for the collection and analysis of code coverage data.

Usage:

coverage.py -x MODULE.py [ARG1 ARG2 ...] Execute module, passing the given command-line arguments, collecting coverage data.

coverage.py -e Erase collected coverage data.

coverage.py -r [-m] FILE1 FILE2 ... Report on the statement coverage for the given files. With the -m option, show line numbers of the statements that weren't executed.

coverage.py -a [-d dir] FILE1 FILE2 ... Make annotated copies of the given files, marking statements that are executed with > and statements that are missed with !. With the -d option, make the copies in that directory. Without the -d option, make each copy in the same directory as the original.

Coverage data is saved in the file .coverage by default. Set the COVERAGE_FILE environment variable to save it somewhere else.

### Classes

StatementFindingAstVisitor |
coverage |

### Functions

analysis |
analysis2 |
annotate |
annotate_file |
erase |
exclude |
report |
save |
start |
stop |
t |
use_cache |

## StatementFindingAstVisitor

### Derived from

compiler.visitor.ASTVisitor

### Methods

StatementFindingAstVisitor |
doCode |
doElse |
doPlainWordSuite |
doRecursive |
doStatement |
doSuite |
getFirstLine |
getLastLine |
recordAndDispatch |
recordLine |
recordNodeLine |
visitFor |
visitGlobal |
visitIf |
visitTryExcept |
visitTryFinally |
visitWhile |

### StatementFindingAstVisitor (Constructor)

StatementFindingAstVisitor(statements, excluded, suite_spots)

### StatementFindingAstVisitor.doCode

doCode(node)

### StatementFindingAstVisitor.doElse

doElse(prevsuite, node)

### StatementFindingAstVisitor.doPlainWordSuite

doPlainWordSuite(prevsuite, suite)

### StatementFindingAstVisitor.doRecursive

doRecursive(node)

### StatementFindingAstVisitor.doStatement

doStatement(node)

### StatementFindingAstVisitor.doSuite

doSuite(intro, body, exclude=0)

### StatementFindingAstVisitor.getFirstLine

getFirstLine(node)

### StatementFindingAstVisitor.getLastLine

getLastLine(node)

### StatementFindingAstVisitor.recordAndDispatch

recordAndDispatch(node)

### StatementFindingAstVisitor.recordLine

recordLine(lineno)

### StatementFindingAstVisitor.recordNodeLine

recordNodeLine(node)

### StatementFindingAstVisitor.visitFor

visitFor(node)

### StatementFindingAstVisitor.visitGlobal

visitGlobal(node)

### StatementFindingAstVisitor.visitIf

visitIf(node)

### StatementFindingAstVisitor.visitTryExcept

visitTryExcept(node)

### StatementFindingAstVisitor.visitTryFinally

visitTryFinally(node)

### StatementFindingAstVisitor.visitWhile

visitWhile(node)
Up

## coverage

### Derived from

None

### Methods

coverage |
analysis |
analysis2 |
analyze_morf |
annotate |
annotate_file |
canonical_filename |
canonicalize_filenames |
command_line |
erase |
exclude |
find_executable_statements |
format_lines |
getExclude |
get_suite_spots |
help |
morf_filename |
morf_name |
report |
restore |
save |
start |
stop |
stringify |

### coverage (Constructor)

coverage(basename = None)

### coverage.analysis

analysis(morf)

### coverage.analysis2

analysis2(morf)

### coverage.analyze_morf

analyze_morf(morf)

### coverage.annotate

annotate(morfs, directory=None, ignore_errors=0)

### coverage.annotate_file

annotate_file(filename, statements, excluded, missing, directory=None)

### coverage.canonical_filename

canonical_filename(filename)

### coverage.canonicalize_filenames

canonicalize_filenames()

### coverage.command_line

command_line()

### coverage.erase

erase()

### coverage.exclude

exclude(re, reset=0)

### coverage.find_executable_statements

find_executable_statements(text, exclude=None)

### coverage.format_lines

format_lines(statements, lines)

### coverage.getExclude

getExclude()

### coverage.get_suite_spots

get_suite_spots(tree, spots)

### coverage.help

help(error=None)

### coverage.morf_filename

morf_filename(morf)

### coverage.morf_name

morf_name(morf)

### coverage.report

report(morfs, show_missing=1, ignore_errors=0)

### coverage.restore

restore()

### coverage.save

save()

### coverage.start

start()

### coverage.stop

stop()

### coverage.stringify

stringify()
Up

## analysis

analysis(*args)
Up

## analysis2

analysis2(*args)
Up

## annotate

annotate(*args)
Up

## annotate_file

annotate_file(*args)
Up

## erase

erase(*args)
Up

## exclude

exclude(*args)
Up

## report

report(*args)
Up

## save

save(*args)
Up

## start

start(*args)
Up

## stop

stop(*args)
Up

## t

t(f, w, a)
Up

## use_cache

use_cache(*args)
Up