summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2012-01-19 08:03:03 -0500
committerNed Batchelder <ned@nedbatchelder.com>2012-01-19 08:03:03 -0500
commit763d4b233b32f75bbfa6b06bb0d69ec2f425793f (patch)
treede0608742ecfcaef3d0257ddaaa55536a903cb9f
parentef4a73a9b97c5904c6e6fa886e321d1fd8a09566 (diff)
downloadpython-coveragepy-763d4b233b32f75bbfa6b06bb0d69ec2f425793f.tar.gz
Some doc clarification from George Paci
-rw-r--r--AUTHORS.txt1
-rw-r--r--CHANGES.txt2
-rw-r--r--doc/cmd.rst12
3 files changed, 12 insertions, 3 deletions
diff --git a/AUTHORS.txt b/AUTHORS.txt
index 0f92184..37acfa7 100644
--- a/AUTHORS.txt
+++ b/AUTHORS.txt
@@ -22,6 +22,7 @@ Sandra Martocchia
Patrick Mezard
Noel O'Boyle
Detlev Offenbach
+George Paci
Catherine Proulx
Brandon Rhodes
Adi Roiban
diff --git a/CHANGES.txt b/CHANGES.txt
index 66bf5c8..75bf618 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -6,7 +6,7 @@ Version 3.5.2b1
---------------
- When running a module with ``coverage run -m <modulename>``, certain details
- of the execution environment weren't the same as for
+ of the execution environment weren't the same as for
``python -m <modulename>``. This had the unfortunate side-effect of making
``coverage run -m unittest discover`` not work if you had tests in a
directory named "test". This fixes `issue 155`_.
diff --git a/doc/cmd.rst b/doc/cmd.rst
index 302eb97..a9c00dc 100644
--- a/doc/cmd.rst
+++ b/doc/cmd.rst
@@ -12,6 +12,7 @@ Coverage command line usage
:history: 20100223T200600, changes for 3.3
:history: 20100725T211700, updated for 3.4
:history: 20110827T212500, updated for 3.5.1, combining aliases
+:history: 20120119T075600, Added some clarification from George Paci
.. highlight:: console
@@ -69,14 +70,21 @@ Your program runs just as if it had been invoked with the Python command line.
Arguments after your file name are passed to your program as usual in
``sys.argv``. Rather than providing a filename, you can use the ``-m`` switch
and specify an importable module name instead, just as you can with the
-Python ``-m`` switch.
+Python ``-m`` switch::
+
+ $ coverage run -m packagename.modulename arg1 arg2
+ blah blah ..your program's output.. blah blah
If you want :ref:`branch coverage <branch>` measurement, use the ``--branch``
flag. Otherwise only statement coverage is measured.
You can specify the code to measure with the ``--source``, ``--include``, and
``--omit`` switches. See :ref:`Specifying source files <source_execution>` for
-more details.
+details of their interpretation. Remember to put options for run after "run",
+but before the program invocation::
+
+ $ coverage run --source=dir1,dir2 my_program.py arg1 arg2
+ $ coverage run --source=dir1,dir2 -m packagename.modulename arg1 arg2
By default, coverage does not measure code installed with the Python
interpreter, for example, the standard library. If you want to measure that