From 20a8e5253459693e939e824a359781e34dae779b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Wed, 15 Feb 2012 22:59:17 -0500 Subject: Use exit status properly with 'python -m coverage' --- AUTHORS.txt | 1 + CHANGES.txt | 3 +++ coverage/__main__.py | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/AUTHORS.txt b/AUTHORS.txt index 37acfa74..f59ab18b 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -22,6 +22,7 @@ Sandra Martocchia Patrick Mezard Noel O'Boyle Detlev Offenbach +JT Olds George Paci Catherine Proulx Brandon Rhodes diff --git a/CHANGES.txt b/CHANGES.txt index 75bf618a..d3ddf148 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -11,6 +11,9 @@ Version 3.5.2b1 ``coverage run -m unittest discover`` not work if you had tests in a directory named "test". This fixes `issue 155`_. +- Now the exit status of your product code is properly used as the process + status when running ``python -m coverage run ...``. Thanks, JT Olds. + .. _issue 155: https://bitbucket.org/ned/coveragepy/issue/155/cant-use-coverage-run-m-unittest-discover diff --git a/coverage/__main__.py b/coverage/__main__.py index af5fa9f6..111ca2e0 100644 --- a/coverage/__main__.py +++ b/coverage/__main__.py @@ -1,3 +1,4 @@ """Coverage.py's main entrypoint.""" +import sys from coverage.cmdline import main -main() +sys.exit(main()) -- cgit v1.2.1