# eric4.DebugClients.Python.PyCoverage

Module for the collection and analysis of code coverage data.

### Classes

CoverageException |
StatementFindingAstVisitor |
coverage |

### Functions

analysis |
analysis2 |
annotate |
annotate_file |
begin_recursive |
end_recursive |
erase |
exclude |
report |
start |
stop |
use_cache |

## CoverageException

### Derived from

Exception

### Methods

None

Up

## 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 |
begin_recursive |
canonical_filename |
canonicalize_filenames |
collect |
command_line |
end_recursive |
erase |
exclude |
filter_by_prefix | Return list of morfs where the morf name does not begin with any one of the omit_prefixes.
find_executable_statements |
fix_frame_filename | Public method used to fixup the filename for a given frame.
format_lines |
getExclude |
get_ready |
get_suite_spots |
help |
merge_data |
merge_file_data |
morf_filename |
morf_name | Return the name of morf as used in report.
morf_name_compare |
relative_filename | Convert filename to relative filename from self.relative_dir.
report |
restore |
restore_file |
save |
start |
stop |
stringify |
t |
use_cache |

#### 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, omit_prefixes=[])

#### coverage.annotate_file

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

#### coverage.begin_recursive

begin_recursive()

#### coverage.canonical_filename

canonical_filename(filename)

#### coverage.canonicalize_filenames

canonicalize_filenames()

#### coverage.collect

collect()

#### coverage.command_line

command_line(argv, help=None)

#### coverage.end_recursive

end_recursive()

#### coverage.erase

erase()

#### coverage.exclude

exclude(re, reset = 0)

#### coverage.filter_by_prefix

filter_by_prefix(morfs, omit_prefixes)

Return list of morfs where the morf name does not begin with any one of the omit_prefixes.

#### coverage.find_executable_statements

find_executable_statements(text, exclude=None)

#### coverage.fix_frame_filename

fix_frame_filename(frame)

Public method used to fixup the filename for a given frame.

The logic employed here is that if a module was loaded from a .pyc file, then the correct .py to operate with should be in the same path as the .pyc. The reason this logic is needed is that when a .pyc file is generated, the filename embedded and thus what is readable in the code object of the frame object is the fully qualified filepath when the pyc is generated. If files are moved from machine to machine this can break debugging as the .pyc will refer to the .py on the original machine. Another case might be sharing code over a network... This logic deals with that.

frame
  the frame object

#### coverage.format_lines

format_lines(statements, lines)

#### coverage.getExclude

getExclude()

#### coverage.get_ready

get_ready(parallel_mode=False)

#### coverage.get_suite_spots

get_suite_spots(tree, spots)

#### coverage.help

help(error=None)

#### coverage.merge_data

merge_data(new_data)

#### coverage.merge_file_data

merge_file_data(cache_data, new_data)

#### coverage.morf_filename

morf_filename(morf)

#### coverage.morf_name

morf_name(morf)

Return the name of morf as used in report.

#### coverage.morf_name_compare

morf_name_compare(x, y)

#### coverage.relative_filename

relative_filename(filename)

Convert filename to relative filename from self.relative_dir.

#### coverage.report

report(morfs, show_missing=1, ignore_errors=0, file=None, omit_prefixes=[])

#### coverage.restore

restore()

#### coverage.restore_file

restore_file(file_name)

#### coverage.save

save()

#### coverage.start

start(parallel_mode=False)

#### coverage.stop

stop()

#### coverage.stringify

stringify()

#### coverage.t

t(f, w, a)

#### coverage.use_cache

use_cache(usecache, cache_file=None)
Up

## analysis

analysis(*args, **kw)
Up

## analysis2

analysis2(*args, **kw)
Up

## annotate

annotate(*args, **kw)
Up

## annotate_file

annotate_file(*args, **kw)
Up

## begin_recursive

begin_recursive(*args, **kw)
Up

## end_recursive

end_recursive(*args, **kw)
Up

## erase

erase(*args, **kw)
Up

## exclude

exclude(*args, **kw)
Up

## report

report(*args, **kw)
Up

## start

start(*args, **kw)
Up

## stop

stop(*args, **kw)
Up

## use_cache

use_cache(*args, **kw)
Up