diff options
| author | Ned Batchelder <ned@nedbatchelder.com> | 2009-06-13 16:39:37 -0400 |
|---|---|---|
| committer | Ned Batchelder <ned@nedbatchelder.com> | 2009-06-13 16:39:37 -0400 |
| commit | 92fd89923847f40a981224f0782caa6edd9a7f06 (patch) | |
| tree | 772004948a2c0dc4180ac1e1a90101154503dfef /doc/cmd.rst | |
| parent | 782a37813ba18cd01f340eeb18fd01f7860a9a63 (diff) | |
| download | python-coveragepy-92fd89923847f40a981224f0782caa6edd9a7f06.tar.gz | |
Finish up the docs.
Diffstat (limited to 'doc/cmd.rst')
| -rw-r--r-- | doc/cmd.rst | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/doc/cmd.rst b/doc/cmd.rst index 4d49e3f..0a9f0f6 100644 --- a/doc/cmd.rst +++ b/doc/cmd.rst @@ -128,8 +128,39 @@ decorated to show the status of each line. Here's a `sample report </code/coverage/sample_html/index.html>`_. +Lines are highlighted green for executed, red for missing, and gray for +excluded. The counts at the top of the file are buttons to turn on and off +the highlighting. -Annotation ----------- +The -d argument to specify an output directory is required:: -text annotation too! + $ coverage -b -d covhtml + + +Text Annotation +--------------- + +The -a flag produces a text annotation of your source code. With a -d argument +specifying an output directory, each Python file becomes a text file in that +directory. Without -d, the files are written into the same directories as the +original Python files. + +Coverage status for each line of source is indicated with a character prefix:: + + > executed + ! missing (not executed) + - excluded + +For example:: + + # A simple function, never called with x==1 + + > def h(x): + """Silly function.""" + - if 0: #pragma: no cover + - pass + > if x == 1: + ! a = 1 + > else: + > a = 2 + |
