diff options
-rw-r--r-- | CHANGES.txt | 7 | ||||
-rw-r--r-- | coverage/config.py | 3 | ||||
-rw-r--r-- | coverage/control.py | 5 | ||||
-rw-r--r-- | doc/config.rst | 7 | ||||
-rw-r--r-- | test/test_config.py | 3 |
5 files changed, 20 insertions, 5 deletions
diff --git a/CHANGES.txt b/CHANGES.txt index 52881038..27b8e8ad 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -7,7 +7,7 @@ Version 3.5.2b1 - Source files with custom encodings declared in a comment at the top are now properly handled during reporting on Python 2. Python 3 always handled them - properly. This fixes `issue 157`_. + properly. This fixes `issue 157`_. - Backup files left behind by editors are no longer collected by the source= option, fixing `issue 168`_. @@ -16,6 +16,10 @@ Version 3.5.2b1 if the filename seems like maybe it wasn't meant to be Python. This is a pragmatic fix for `issue 82`_. +- The ``-m`` switch on ``coverage report``, which includes missing line numbers + in the summary report, can now be specifed as ``show_missing`` in the + config file. Closes `issue 173`_. + - When running a module with ``coverage run -m <modulename>``, certain details of the execution environment weren't the same as for ``python -m <modulename>``. This had the unfortunate side-effect of making @@ -33,6 +37,7 @@ Version 3.5.2b1 .. _issue 157: https://bitbucket.org/ned/coveragepy/issue/157/chokes-on-source-files-with-non-utf-8 .. _issue 166: https://bitbucket.org/ned/coveragepy/issue/166/dont-try-to-compile-c-extension-on-pypy .. _issue 168: https://bitbucket.org/ned/coveragepy/issue/168/dont-be-alarmed-by-emacs-droppings +.. _issue 173: https://bitbucket.org/ned/coveragepy/issue/173/theres-no-way-to-specify-show-missing-in Version 3.5.1 --- 23 September 2011 diff --git a/coverage/config.py b/coverage/config.py index e72a728b..ef45ba5a 100644 --- a/coverage/config.py +++ b/coverage/config.py @@ -48,6 +48,7 @@ class CoverageConfig(object): self.partial_list = DEFAULT_PARTIAL[:] self.partial_always_list = DEFAULT_PARTIAL_ALWAYS[:] self.precision = 0 + self.show_missing = False # Defaults for [html] self.html_dir = "htmlcov" @@ -118,6 +119,8 @@ class CoverageConfig(object): self.get_line_list(cp, 'report', 'partial_branches_always') if cp.has_option('report', 'precision'): self.precision = cp.getint('report', 'precision') + if cp.has_option('report', 'show_missing'): + self.show_missing = cp.getboolean('report', 'show_missing') # [html] if cp.has_option('html', 'directory'): diff --git a/coverage/control.py b/coverage/control.py index eea6b00a..ca2a51ab 100644 --- a/coverage/control.py +++ b/coverage/control.py @@ -557,10 +557,11 @@ class coverage(object): """ self.config.from_args( - ignore_errors=ignore_errors, omit=omit, include=include + ignore_errors=ignore_errors, omit=omit, include=include, + show_missing=show_missing, ) reporter = SummaryReporter( - self, show_missing, self.config.ignore_errors + self, self.config.show_missing, self.config.ignore_errors ) reporter.report(morfs, outfile=file, config=self.config) diff --git a/doc/config.rst b/doc/config.rst index aed52300..7a54eec5 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -161,12 +161,15 @@ supply the "pragma: no branch" regex if you still want to use it. display for reported coverage percentages. The default is 0, displaying for example "87%". A value of 2 will display percentages like "87.32%". +``show_missing`` (boolean, default False): when running a summary report, +show missing lines. See :ref:`cmd_summary` for more information. + [html] ------ Values particular to HTML reporting. The values in the ``[report]`` section -also apply to HTML output. +also apply to HTML output, where appropriate. ``directory`` (string, default "htmlcov"): where to write the HTML report files. @@ -175,6 +178,6 @@ also apply to HTML output. ----- Values particular to XML reporting. The values in the ``[report]`` section -also apply to XML output. +also apply to XML output, where appropriate. ``output`` (string, default "coverage.xml"): where to write the XML report. diff --git a/test/test_config.py b/test/test_config.py index 13ec0f3c..236216f6 100644 --- a/test/test_config.py +++ b/test/test_config.py @@ -133,6 +133,8 @@ class ConfigFileTest(CoverageTest): if 0: while True: + show_missing= TruE + [html] directory = c:\\tricky\\dir.somewhere @@ -172,6 +174,7 @@ class ConfigFileTest(CoverageTest): self.assertEqual(cov.config.partial_always_list, ["if 0:", "while True:"] ) + self.assertTrue(cov.config.show_missing) self.assertEqual(cov.config.html_dir, r"c:\tricky\dir.somewhere") self.assertEqual(cov.config.xml_output, "mycov.xml") |