Hello community,
here is the log from the commit of package python3-pytest-cov for
openSUSE:Factory checked in at 2016-07-18 21:22:03
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python3-pytest-cov (Old)
and /work/SRC/openSUSE:Factory/.python3-pytest-cov.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python3-pytest-cov"
Changes:
--------
--- /work/SRC/openSUSE:Factory/python3-pytest-cov/python3-pytest-cov.changes
2016-05-17 17:12:16.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.python3-pytest-cov.new/python3-pytest-cov.changes
2016-07-18 21:22:05.000000000 +0200
@@ -1,0 +2,16 @@
+Thu Jul 7 06:43:58 UTC 2016 - [email protected]
+
+- update to version 2.3.0:
+ * Add support for specifying output location for html, xml, and
+ annotate report. Contributed by Patrick Lannigan in PR#113.
+ * Fix bug hiding test failure when cov-fail-under failed.
+ * For coverage >= 4.0, match the default behaviour of coverage
+ report and error if coverage fails to find the source instead of
+ just printing a warning. Contributed by David Szotten in PR#116.
+ * Fixed bug occurred when bare --cov parameter was used with
+ xdist. Contributed by Michael Elovskikh in PR#120.
+ * Add support for skip_covered and added
+ --cov-report=term-skip-covered command line options. Contributed
+ by Saurabh Kumar in PR#115.
+
+-------------------------------------------------------------------
@@ -6 +21,0 @@
-
Old:
----
pytest-cov-2.2.1.tar.gz
New:
----
pytest-cov-2.3.0.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python3-pytest-cov.spec ++++++
--- /var/tmp/diff_new_pack.6T4AuH/_old 2016-07-18 21:22:06.000000000 +0200
+++ /var/tmp/diff_new_pack.6T4AuH/_new 2016-07-18 21:22:06.000000000 +0200
@@ -17,7 +17,7 @@
Name: python3-pytest-cov
-Version: 2.2.1
+Version: 2.3.0
Release: 0
Summary: Pytest plugin for coverage reporting
License: MIT
++++++ pytest-cov-2.2.1.tar.gz -> pytest-cov-2.3.0.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/.bumpversion.cfg
new/pytest-cov-2.3.0/.bumpversion.cfg
--- old/pytest-cov-2.2.1/.bumpversion.cfg 2016-01-30 10:03:56.000000000
+0100
+++ new/pytest-cov-2.3.0/.bumpversion.cfg 2016-07-05 21:54:31.000000000
+0200
@@ -1,5 +1,5 @@
[bumpversion]
-current_version = 2.2.1
+current_version = 2.3.0
commit = True
tag = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/.travis.yml
new/pytest-cov-2.3.0/.travis.yml
--- old/pytest-cov-2.2.1/.travis.yml 2016-01-11 03:24:59.000000000 +0100
+++ new/pytest-cov-2.3.0/.travis.yml 2016-06-01 11:13:14.000000000 +0200
@@ -14,36 +14,54 @@
- TOXENV=py26-28-37
- TOXENV=py26-28-40
- TOXENV=py26-28-41
+ - TOXENV=py26-29-37
+ - TOXENV=py26-29-40
+ - TOXENV=py26-29-41
- TOXENV=py27-27-37
- TOXENV=py27-27-40
- TOXENV=py27-27-41
- TOXENV=py27-28-37
- TOXENV=py27-28-40
- TOXENV=py27-28-41
+ - TOXENV=py27-29-37
+ - TOXENV=py27-29-40
+ - TOXENV=py27-29-41
- TOXENV=py33-27-37
- TOXENV=py33-27-40
- TOXENV=py33-27-41
- TOXENV=py33-28-37
- TOXENV=py33-28-40
- TOXENV=py33-28-41
+ - TOXENV=py33-29-37
+ - TOXENV=py33-29-40
+ - TOXENV=py33-29-41
- TOXENV=py34-27-37
- TOXENV=py34-27-40
- TOXENV=py34-27-41
- TOXENV=py34-28-37
- TOXENV=py34-28-40
- TOXENV=py34-28-41
+ - TOXENV=py34-29-37
+ - TOXENV=py34-29-40
+ - TOXENV=py34-29-41
- TOXENV=py35-27-37
- TOXENV=py35-27-40
- TOXENV=py35-27-41
- TOXENV=py35-28-37
- TOXENV=py35-28-40
- TOXENV=py35-28-41
+ - TOXENV=py35-29-37
+ - TOXENV=py35-29-40
+ - TOXENV=py35-29-41
- TOXENV=pypy-27-37
- TOXENV=pypy-27-40
- TOXENV=pypy-27-41
- TOXENV=pypy-28-37
- TOXENV=pypy-28-40
- TOXENV=pypy-28-41
+ - TOXENV=pypy-29-37
+ - TOXENV=pypy-29-40
+ - TOXENV=pypy-29-41
before_install:
- python --version
- uname -a
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/AUTHORS.rst
new/pytest-cov-2.3.0/AUTHORS.rst
--- old/pytest-cov-2.2.1/AUTHORS.rst 2016-01-11 03:18:19.000000000 +0100
+++ new/pytest-cov-2.3.0/AUTHORS.rst 2016-06-20 22:00:36.000000000 +0200
@@ -10,5 +10,10 @@
* Guillaume Ayoub - http://www.yabz.fr/
* Federico Ceratto - http://firelet.net/
* Josh Kalderimis - http://blog.cookiestack.com/
-* Ionel Cristian Mărieș - http://blog.ionelmc.ro
+* Ionel Cristian Mărieș - https://blog.ionelmc.ro
* Christian Ledermann - https://github.com/cleder
+* Alec Nikolas Reiter - https://github.com/justanr
+* Patrick Lannigan - https://github.com/unholysampler
+* David Szotten - https://github.com/davidszotten
+* Michael Elovskikh - https://github.com/wronglink
+* Saurabh Kumar - https://github.com/theskumar
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/CHANGELOG.rst
new/pytest-cov-2.3.0/CHANGELOG.rst
--- old/pytest-cov-2.2.1/CHANGELOG.rst 2016-01-30 10:00:58.000000000 +0100
+++ new/pytest-cov-2.3.0/CHANGELOG.rst 2016-07-05 21:54:04.000000000 +0200
@@ -1,6 +1,20 @@
Changelog
=========
+2.3.0 (2016-07-05)
+------------------
+
+* Add support for specifying output location for html, xml, and annotate
report.
+ Contributed by Patrick Lannigan in `PR#113
<https://github.com/pytest-dev/pytest-cov/pull/113>`_.
+* Fix bug hiding test failure when cov-fail-under failed.
+* For coverage >= 4.0, match the default behaviour of `coverage report` and
+ error if coverage fails to find the source instead of just printing a
warning.
+ Contributed by David Szotten in `PR#116
<https://github.com/pytest-dev/pytest-cov/pull/116>`_.
+* Fixed bug occurred when bare ``--cov`` parameter was used with xdist.
+ Contributed by Michael Elovskikh in `PR#120
<https://github.com/pytest-dev/pytest-cov/pull/120>`_.
+* Add support for ``skip_covered`` and added
``--cov-report=term-skip-covered`` command
+ line options. Contributed by Saurabh Kumar in `PR#115
<https://github.com/pytest-dev/pytest-cov/pull/115>`_.
+
2.2.1 (2016-01-30)
------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/CONTRIBUTING.rst
new/pytest-cov-2.3.0/CONTRIBUTING.rst
--- old/pytest-cov-2.2.1/CONTRIBUTING.rst 2016-01-11 03:24:59.000000000
+0100
+++ new/pytest-cov-2.3.0/CONTRIBUTING.rst 2016-06-20 21:48:45.000000000
+0200
@@ -48,7 +48,7 @@
Now you can make your changes locally.
-4. When you're done making changes, run all the checks, doc builder and spell
checker with `tox <http://tox.readthedocs.org/en/latest/install.html>`_ one
command::
+4. When you're done making changes, run all the checks, doc builder and spell
checker with `tox <https://tox.readthedocs.io/en/latest/install.html>`_ one
command::
tox
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/PKG-INFO
new/pytest-cov-2.3.0/PKG-INFO
--- old/pytest-cov-2.2.1/PKG-INFO 2016-01-30 10:04:10.000000000 +0100
+++ new/pytest-cov-2.3.0/PKG-INFO 2016-07-05 21:54:49.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest-cov
-Version: 2.2.1
+Version: 2.3.0
Summary: Pytest plugin for measuring coverage.
Home-page: https://github.com/pytest-dev/pytest-cov
Author: Marc Schlaich
@@ -105,7 +105,7 @@
Centralised Testing
-------------------
- Centralised testing will report on the combined coverage of the main
process and all of it's
+ Centralised testing will report on the combined coverage of the main
process and all of its
subprocesses.
Running centralised testing::
@@ -129,7 +129,7 @@
Distributed testing with dist mode set to load will report on the
combined coverage of all slaves.
The slaves may be spread out over any number of hosts and each slave
may be located anywhere on the
- file system. Each slave will have it's subprocesses measured.
+ file system. Each slave will have its subprocesses measured.
Running distributed testing with dist mode set to load::
@@ -231,6 +231,21 @@
--------------------------------------------------
TOTAL 353 20 94%
+ The terminal report with skip covered::
+
+ py.test --cov-report term:skip-covered --cov=myproj tests/
+
+ -------------------- coverage: platform linux2, python
2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+ 1 files skipped due to complete coverage.
+
+ You can use ``skip-covered`` with ``term-missing`` as well. e.g.
``--cov-report term-missing:skip-covered``
These three report options output to files without showing anything on
the terminal::
@@ -239,6 +254,15 @@
--cov-report annotate
--cov=myproj tests/
+ The output location for each of these reports can be specified. The
output location for the XML
+ report is a file. Where as the output location for the HTML and
annotated source code reports are
+ directories::
+
+ py.test --cov-report html:cov_html
+ --cov-report xml:cov.xml
+ --cov-report annotate:cov_annotate
+ --cov=myproj tests/
+
The final report option can also suppress printing to the terminal::
py.test --cov-report= --cov=myproj tests/
@@ -278,7 +302,7 @@
For full details refer to the `coverage config file`_ documentation.
- .. _`coverage config file`:
http://nedbatchelder.com/code/coverage/config.html
+ .. _`coverage config file`:
https://coverage.readthedocs.io/en/latest/config.html
Note that this plugin controls some options and setting the option in
the config file will have no
effect. These include specifying source to be measured (source
option) and all data file handling
@@ -316,6 +340,20 @@
Changelog
=========
+ 2.3.0 (2016-07-05)
+ ------------------
+
+ * Add support for specifying output location for html, xml, and
annotate report.
+ Contributed by Patrick Lannigan in `PR#113
<https://github.com/pytest-dev/pytest-cov/pull/113>`_.
+ * Fix bug hiding test failure when cov-fail-under failed.
+ * For coverage >= 4.0, match the default behaviour of `coverage
report` and
+ error if coverage fails to find the source instead of just printing
a warning.
+ Contributed by David Szotten in `PR#116
<https://github.com/pytest-dev/pytest-cov/pull/116>`_.
+ * Fixed bug occurred when bare ``--cov`` parameter was used with xdist.
+ Contributed by Michael Elovskikh in `PR#120
<https://github.com/pytest-dev/pytest-cov/pull/120>`_.
+ * Add support for ``skip_covered`` and added
``--cov-report=term-skip-covered`` command
+ line options. Contributed by Saurabh Kumar in `PR#115
<https://github.com/pytest-dev/pytest-cov/pull/115>`_.
+
2.2.1 (2016-01-30)
------------------
@@ -361,18 +399,20 @@
Keywords: cover,coverage,pytest,py.test,distributed,parallel
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
+Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: Unix
-Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Testing
+Classifier: Topic :: Utilities
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/README.rst
new/pytest-cov-2.3.0/README.rst
--- old/pytest-cov-2.2.1/README.rst 2016-01-21 09:16:45.000000000 +0100
+++ new/pytest-cov-2.3.0/README.rst 2016-06-20 22:00:36.000000000 +0200
@@ -97,7 +97,7 @@
Centralised Testing
-------------------
-Centralised testing will report on the combined coverage of the main process
and all of it's
+Centralised testing will report on the combined coverage of the main process
and all of its
subprocesses.
Running centralised testing::
@@ -121,7 +121,7 @@
Distributed testing with dist mode set to load will report on the combined
coverage of all slaves.
The slaves may be spread out over any number of hosts and each slave may be
located anywhere on the
-file system. Each slave will have it's subprocesses measured.
+file system. Each slave will have its subprocesses measured.
Running distributed testing with dist mode set to load::
@@ -223,6 +223,21 @@
--------------------------------------------------
TOTAL 353 20 94%
+The terminal report with skip covered::
+
+ py.test --cov-report term:skip-covered --cov=myproj tests/
+
+ -------------------- coverage: platform linux2, python 2.6.4-final-0
---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+ 1 files skipped due to complete coverage.
+
+You can use ``skip-covered`` with ``term-missing`` as well. e.g.
``--cov-report term-missing:skip-covered``
These three report options output to files without showing anything on the
terminal::
@@ -231,6 +246,15 @@
--cov-report annotate
--cov=myproj tests/
+The output location for each of these reports can be specified. The output
location for the XML
+report is a file. Where as the output location for the HTML and annotated
source code reports are
+directories::
+
+ py.test --cov-report html:cov_html
+ --cov-report xml:cov.xml
+ --cov-report annotate:cov_annotate
+ --cov=myproj tests/
+
The final report option can also suppress printing to the terminal::
py.test --cov-report= --cov=myproj tests/
@@ -270,7 +294,7 @@
For full details refer to the `coverage config file`_ documentation.
-.. _`coverage config file`: http://nedbatchelder.com/code/coverage/config.html
+.. _`coverage config file`:
https://coverage.readthedocs.io/en/latest/config.html
Note that this plugin controls some options and setting the option in the
config file will have no
effect. These include specifying source to be measured (source option) and
all data file handling
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/appveyor.yml
new/pytest-cov-2.3.0/appveyor.yml
--- old/pytest-cov-2.2.1/appveyor.yml 2016-01-11 03:24:59.000000000 +0100
+++ new/pytest-cov-2.3.0/appveyor.yml 2016-06-01 11:13:14.000000000 +0200
@@ -89,6 +89,45 @@
PYTHON_VERSION: '2.7'
PYTHON_ARCH: '64'
+ - TOXENV: 'py27-29-37'
+ TOXPYTHON: C:\Python27\python.exe
+ PYTHON_HOME: C:\Python27
+ PYTHON_VERSION: '2.7'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py27-29-37'
+ TOXPYTHON: C:\Python27-x64\python.exe
+ WINDOWS_SDK_VERSION: v7.0
+ PYTHON_HOME: C:\Python27-x64
+ PYTHON_VERSION: '2.7'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py27-29-40'
+ TOXPYTHON: C:\Python27\python.exe
+ PYTHON_HOME: C:\Python27
+ PYTHON_VERSION: '2.7'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py27-29-40'
+ TOXPYTHON: C:\Python27-x64\python.exe
+ WINDOWS_SDK_VERSION: v7.0
+ PYTHON_HOME: C:\Python27-x64
+ PYTHON_VERSION: '2.7'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py27-29-41'
+ TOXPYTHON: C:\Python27\python.exe
+ PYTHON_HOME: C:\Python27
+ PYTHON_VERSION: '2.7'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py27-29-41'
+ TOXPYTHON: C:\Python27-x64\python.exe
+ WINDOWS_SDK_VERSION: v7.0
+ PYTHON_HOME: C:\Python27-x64
+ PYTHON_VERSION: '2.7'
+ PYTHON_ARCH: '64'
+
- TOXENV: 'py34-27-37'
TOXPYTHON: C:\Python34\python.exe
PYTHON_HOME: C:\Python34
@@ -167,6 +206,45 @@
PYTHON_VERSION: '3.4'
PYTHON_ARCH: '64'
+ - TOXENV: 'py34-29-37'
+ TOXPYTHON: C:\Python34\python.exe
+ PYTHON_HOME: C:\Python34
+ PYTHON_VERSION: '3.4'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py34-29-37'
+ TOXPYTHON: C:\Python34-x64\python.exe
+ WINDOWS_SDK_VERSION: v7.1
+ PYTHON_HOME: C:\Python34-x64
+ PYTHON_VERSION: '3.4'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py34-29-40'
+ TOXPYTHON: C:\Python34\python.exe
+ PYTHON_HOME: C:\Python34
+ PYTHON_VERSION: '3.4'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py34-29-40'
+ TOXPYTHON: C:\Python34-x64\python.exe
+ WINDOWS_SDK_VERSION: v7.1
+ PYTHON_HOME: C:\Python34-x64
+ PYTHON_VERSION: '3.4'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py34-29-41'
+ TOXPYTHON: C:\Python34\python.exe
+ PYTHON_HOME: C:\Python34
+ PYTHON_VERSION: '3.4'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py34-29-41'
+ TOXPYTHON: C:\Python34-x64\python.exe
+ WINDOWS_SDK_VERSION: v7.1
+ PYTHON_HOME: C:\Python34-x64
+ PYTHON_VERSION: '3.4'
+ PYTHON_ARCH: '64'
+
- TOXENV: 'py35-27-37'
TOXPYTHON: C:\Python35\python.exe
PYTHON_HOME: C:\Python35
@@ -237,6 +315,42 @@
TOXPYTHON: C:\Python35-x64\python.exe
PYTHON_HOME: C:\Python35-x64
PYTHON_VERSION: '3.5'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py35-29-37'
+ TOXPYTHON: C:\Python35\python.exe
+ PYTHON_HOME: C:\Python35
+ PYTHON_VERSION: '3.5'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py35-29-37'
+ TOXPYTHON: C:\Python35-x64\python.exe
+ PYTHON_HOME: C:\Python35-x64
+ PYTHON_VERSION: '3.5'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py35-29-40'
+ TOXPYTHON: C:\Python35\python.exe
+ PYTHON_HOME: C:\Python35
+ PYTHON_VERSION: '3.5'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py35-29-40'
+ TOXPYTHON: C:\Python35-x64\python.exe
+ PYTHON_HOME: C:\Python35-x64
+ PYTHON_VERSION: '3.5'
+ PYTHON_ARCH: '64'
+
+ - TOXENV: 'py35-29-41'
+ TOXPYTHON: C:\Python35\python.exe
+ PYTHON_HOME: C:\Python35
+ PYTHON_VERSION: '3.5'
+ PYTHON_ARCH: '32'
+
+ - TOXENV: 'py35-29-41'
+ TOXPYTHON: C:\Python35-x64\python.exe
+ PYTHON_HOME: C:\Python35-x64
+ PYTHON_VERSION: '3.5'
PYTHON_ARCH: '64'
init:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/docs/conf.py
new/pytest-cov-2.3.0/docs/conf.py
--- old/pytest-cov-2.2.1/docs/conf.py 2016-01-30 10:03:56.000000000 +0100
+++ new/pytest-cov-2.3.0/docs/conf.py 2016-07-05 21:54:31.000000000 +0200
@@ -25,7 +25,7 @@
year = '2016'
author = 'pytest-cov contributors'
copyright = '{0}, {1}'.format(year, author)
-version = release = '2.2.1'
+version = release = '2.3.0'
pygments_style = 'trac'
templates_path = ['.']
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/docs/releasing.rst
new/pytest-cov-2.3.0/docs/releasing.rst
--- old/pytest-cov-2.2.1/docs/releasing.rst 2015-08-30 01:43:36.000000000
+0200
+++ new/pytest-cov-2.3.0/docs/releasing.rst 2016-06-20 21:57:55.000000000
+0200
@@ -10,12 +10,12 @@
#. Update ``CHANGELOG.rst`` and ``AUTHORS.rst`` to be up to date.
#. Bump the version by running ``bumpversion [ major | minor | patch ]``. This
will automatically add a tag.
- Alternativelly, you can manually edit the files and run ``git tag v1.2.3``
yourself.
+ Alternatively, you can manually edit the files and run ``git tag v1.2.3``
yourself.
#. Push changes and tags with::
git push
git push --tags
-#. Wait for `AppVeyor <https://ci.appveyor.com/project/schlamar/pytest-cov>`_
+#. Wait for `AppVeyor <https://ci.appveyor.com/project/pytestbot/pytest-cov>`_
and `Travis <https://travis-ci.org/schlamar/pytest-cov>`_ to give the green
builds.
#. Check that the docs on `ReadTheDocs
<https://readthedocs.org/projects/pytest-cov>`_ are built.
#. Make sure you have a clean checkout, run ``git status`` to verify.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/setup.cfg
new/pytest-cov-2.3.0/setup.cfg
--- old/pytest-cov-2.2.1/setup.cfg 2016-01-30 10:04:10.000000000 +0100
+++ new/pytest-cov-2.3.0/setup.cfg 2016-07-05 21:54:49.000000000 +0200
@@ -13,6 +13,7 @@
.git
.tox
.env
+ venv
dist
build
south_migrations
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/setup.py
new/pytest-cov-2.3.0/setup.py
--- old/pytest-cov-2.2.1/setup.py 2016-01-30 10:03:56.000000000 +0100
+++ new/pytest-cov-2.3.0/setup.py 2016-07-05 21:54:31.000000000 +0200
@@ -82,7 +82,7 @@
setup(
name='pytest-cov',
- version='2.2.1',
+ version='2.3.0',
license='MIT',
description='Pytest plugin for measuring coverage.',
long_description='%s\n%s' % (read('README.rst'),
re.sub(':[a-z]+:`~?(.*?)`', r'``\1``', read('CHANGELOG.rst'))),
@@ -97,21 +97,23 @@
classifiers=[
# complete classifier list:
http://pypi.python.org/pypi?%3Aaction=list_classifiers
'Development Status :: 5 - Production/Stable',
+ 'Framework :: Pytest',
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
- 'Operating System :: Unix',
- 'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
+ 'Operating System :: POSIX',
+ 'Operating System :: Unix',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
+ 'Topic :: Software Development :: Testing',
'Topic :: Utilities',
- 'Topic :: Software Development :: Testing'
],
keywords=[
'cover', 'coverage', 'pytest', 'py.test', 'distributed', 'parallel',
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/src/pytest_cov/__init__.py
new/pytest-cov-2.3.0/src/pytest_cov/__init__.py
--- old/pytest-cov-2.2.1/src/pytest_cov/__init__.py 2016-01-30
10:03:56.000000000 +0100
+++ new/pytest-cov-2.3.0/src/pytest_cov/__init__.py 2016-07-05
21:54:31.000000000 +0200
@@ -1 +1 @@
-__version__ = "2.2.1"
+__version__ = "2.3.0"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/src/pytest_cov/compat.py
new/pytest-cov-2.3.0/src/pytest_cov/compat.py
--- old/pytest-cov-2.2.1/src/pytest_cov/compat.py 1970-01-01
01:00:00.000000000 +0100
+++ new/pytest-cov-2.3.0/src/pytest_cov/compat.py 2016-06-01
11:07:37.000000000 +0200
@@ -0,0 +1,31 @@
+try:
+ from StringIO import StringIO
+except ImportError:
+ from io import StringIO
+
+import pytest
+
+StringIO # pyflakes, this is for re-export
+
+
+if hasattr(pytest, 'hookimpl'):
+ hookwrapper = pytest.hookimpl(hookwrapper=True)
+else:
+ hookwrapper = pytest.mark.hookwrapper
+
+
+class SessionWrapper(object):
+ def __init__(self, session):
+ self._session = session
+ if hasattr(session, 'testsfailed'):
+ self._attr = 'testsfailed'
+ else:
+ self._attr = '_testsfailed'
+
+ @property
+ def testsfailed(self):
+ return getattr(self._session, self._attr)
+
+ @testsfailed.setter
+ def testsfailed(self, value):
+ setattr(self._session, self._attr, value)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/src/pytest_cov/engine.py
new/pytest-cov-2.3.0/src/pytest_cov/engine.py
--- old/pytest-cov-2.2.1/src/pytest_cov/engine.py 2016-01-30
10:00:17.000000000 +0100
+++ new/pytest-cov-2.3.0/src/pytest_cov/engine.py 2016-06-20
21:48:45.000000000 +0200
@@ -4,14 +4,12 @@
import random
import socket
import sys
-try:
- from StringIO import StringIO
-except ImportError:
- from io import StringIO
import coverage
from coverage.data import CoverageData
+from .compat import StringIO
+
class CovController(object):
"""Base class for different plugin implementations."""
@@ -35,8 +33,7 @@
if self.cov_source is None:
os.environ['COV_CORE_SOURCE'] = ''
else:
- os.environ['COV_CORE_SOURCE'] = os.pathsep.join(
- os.path.abspath(p) for p in self.cov_source)
+ os.environ['COV_CORE_SOURCE'] = os.pathsep.join(self.cov_source)
config_file = os.path.abspath(self.cov_config)
if os.path.exists(config_file):
os.environ['COV_CORE_CONFIG'] = config_file
@@ -86,26 +83,37 @@
self.sep(stream, ' ', '%s' % node_desc)
# Produce terminal report if wanted.
- if 'term' in self.cov_report or 'term-missing' in self.cov_report:
- show_missing = ('term-missing' in self.cov_report) or None
- total = self.cov.report(show_missing=show_missing,
ignore_errors=True, file=stream)
+ if any(x in self.cov_report for x in ['term', 'term-missing']):
+ options = {
+ 'show_missing': ('term-missing' in self.cov_report) or None,
+ 'ignore_errors': True,
+ 'file': stream,
+ }
+ skip_covered = isinstance(self.cov_report, dict) and
'skip-covered' in self.cov_report.values()
+ if hasattr(coverage, 'version_info') and coverage.version_info[0]
>= 4:
+ options.update({'skip_covered': skip_covered or None})
+ total = self.cov.report(**options)
# Produce annotated source code report if wanted.
if 'annotate' in self.cov_report:
- self.cov.annotate(ignore_errors=True)
+ annotate_dir = self.cov_report['annotate']
+ self.cov.annotate(ignore_errors=True, directory=annotate_dir)
# We need to call Coverage.report here, just to get the total
# Coverage.annotate don't return any total and we need it for
--cov-fail-under.
total = self.cov.report(ignore_errors=True, file=StringIO())
- stream.write('Coverage annotated source written next to source\n')
+ if annotate_dir:
+ stream.write('Coverage annotated source written to dir %s\n' %
annotate_dir)
+ else:
+ stream.write('Coverage annotated source written next to
source\n')
# Produce html report if wanted.
if 'html' in self.cov_report:
- total = self.cov.html_report(ignore_errors=True)
+ total = self.cov.html_report(ignore_errors=True,
directory=self.cov_report['html'])
stream.write('Coverage HTML written to dir %s\n' %
self.cov.config.html_dir)
# Produce xml report if wanted.
if 'xml' in self.cov_report:
- total = self.cov.xml_report(ignore_errors=True)
+ total = self.cov.xml_report(ignore_errors=True,
outfile=self.cov_report['xml'])
stream.write('Coverage XML written to file %s\n' %
self.cov.config.xml_output)
# Report on any failed slaves.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/src/pytest_cov/plugin.py
new/pytest-cov-2.3.0/src/pytest_cov/plugin.py
--- old/pytest-cov-2.2.1/src/pytest_cov/plugin.py 2015-08-30
01:45:32.000000000 +0200
+++ new/pytest-cov-2.3.0/src/pytest_cov/plugin.py 2016-06-20
21:48:45.000000000 +0200
@@ -2,16 +2,50 @@
import os
import pytest
+import argparse
from coverage.misc import CoverageException
from . import embed
from . import engine
+from . import compat
class CoverageError(Exception):
"""Indicates that our coverage is too low"""
+def validate_report(arg):
+ file_choices = ['annotate', 'html', 'xml']
+ term_choices = ['term', 'term-missing']
+ term_modifier_choices = ['skip-covered']
+ all_choices = term_choices + file_choices
+ values = arg.split(":", 1)
+ report_type = values[0]
+ if report_type not in all_choices + ['']:
+ msg = 'invalid choice: "{}" (choose from "{}")'.format(arg,
all_choices)
+ raise argparse.ArgumentTypeError(msg)
+
+ if len(values) == 1:
+ return report_type, None
+
+ report_modifier = values[1]
+ if report_type in term_choices and report_modifier in
term_modifier_choices:
+ return report_type, report_modifier
+
+ if report_type not in file_choices:
+ msg = 'output specifier not supported for: "{}" (choose from
"{}")'.format(arg,
+
file_choices)
+ raise argparse.ArgumentTypeError(msg)
+
+ return values
+
+
+class StoreReport(argparse.Action):
+ def __call__(self, parser, namespace, values, option_string=None):
+ report_type, file = values
+ namespace.cov_report[report_type] = file
+
+
def pytest_addoption(parser):
"""Add options to control coverage."""
@@ -21,12 +55,13 @@
nargs='?', const=True, dest='cov_source',
help='measure coverage for filesystem path '
'(multi-allowed)')
- group.addoption('--cov-report', action='append', default=[],
- metavar='type',
- choices=['term', 'term-missing', 'annotate', 'html',
- 'xml', ''],
+ group.addoption('--cov-report', action=StoreReport, default={},
+ metavar='type', type=validate_report,
help='type of report to generate: term, term-missing, '
- 'annotate, html, xml (multi-allowed)')
+ 'annotate, html, xml (multi-allowed). '
+ 'term, term-missing may be followed by ":skip-covered".'
+ 'annotate, html and xml may be be followed by ":DEST" '
+ 'where DEST specifies the output location.')
group.addoption('--cov-config', action='store', default='.coveragerc',
metavar='path',
help='config file for coverage, default: .coveragerc')
@@ -50,8 +85,8 @@
if not ns.cov_report:
ns.cov_report = ['term']
- elif ns.cov_report == ['']:
- ns.cov_report = []
+ elif len(ns.cov_report) == 1 and '' in ns.cov_report:
+ ns.cov_report = {}
if ns.cov:
plugin = CovPlugin(ns, early_config.pluginmanager)
@@ -64,6 +99,8 @@
if not config.pluginmanager.hasplugin('_cov'):
if not config.option.cov_report:
config.option.cov_report = ['term']
+ if config.option.cov_source == [True]:
+ config.option.cov_source = None
plugin = CovPlugin(config.option, config.pluginmanager,
start=False)
@@ -90,6 +127,8 @@
self.pid = None
self.cov = None
self.cov_controller = None
+ self.cov_report = compat.StringIO()
+ self.cov_total = None
self.failed = False
self._started = False
self.options = options
@@ -153,28 +192,55 @@
self.cov_controller.testnodedown(node, error)
pytest_testnodedown.optionalhook = True
- def pytest_sessionfinish(self, session, exitstatus):
- """Delegate to our implementation."""
- self.failed = exitstatus != 0
+ def _should_report(self):
+ return not (self.failed and self.options.no_cov_on_fail)
+
+ def _failed_cov_total(self):
+ cov_fail_under = self.options.cov_fail_under
+ return cov_fail_under is not None and self.cov_total < cov_fail_under
+
+ # we need to wrap pytest_runtestloop. by the time pytest_sessionfinish
+ # runs, it's too late to set testsfailed
+ @compat.hookwrapper
+ def pytest_runtestloop(self, session):
+ yield
+
+ compat_session = compat.SessionWrapper(session)
+
+ self.failed = bool(compat_session.testsfailed)
if self.cov_controller is not None:
self.cov_controller.finish()
+ if self._should_report():
+ try:
+ self.cov_total = self.cov_controller.summary(self.cov_report)
+ except CoverageException as exc:
+ raise pytest.UsageError(
+ 'Failed to generate report: %s\n' % exc
+ )
+ assert self.cov_total is not None, 'Test coverage should never be
`None`'
+ if self._failed_cov_total():
+ # make sure we get the EXIT_TESTSFAILED exit code
+ compat_session.testsfailed += 1
+
def pytest_terminal_summary(self, terminalreporter):
- """Delegate to our implementation."""
if self.cov_controller is None:
return
- if not (self.failed and self.options.no_cov_on_fail):
- try:
- total = self.cov_controller.summary(terminalreporter.writer)
- except CoverageException as exc:
- terminalreporter.writer.write('Failed to generate report:
%s\n' % exc)
- total = 0
- assert total is not None, 'Test coverage should never be `None`'
- cov_fail_under = self.options.cov_fail_under
- if cov_fail_under is not None and total < cov_fail_under:
- raise CoverageError(('Required test coverage of %d%% not '
- 'reached. Total coverage: %.2f%%')
- % (self.options.cov_fail_under, total))
+
+ if self.cov_total is None:
+ # we shouldn't report, or report generation failed (error raised
above)
+ return
+
+ terminalreporter.write('\n' + self.cov_report.getvalue() + '\n')
+
+ if self._failed_cov_total():
+ markup = {'red': True, 'bold': True}
+ msg = (
+ 'FAIL Required test coverage of %d%% not '
+ 'reached. Total coverage: %.2f%%\n'
+ % (self.options.cov_fail_under, self.cov_total)
+ )
+ terminalreporter.write(msg, **markup)
def pytest_runtest_setup(self, item):
if os.getpid() != self.pid:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/src/pytest_cov.egg-info/PKG-INFO
new/pytest-cov-2.3.0/src/pytest_cov.egg-info/PKG-INFO
--- old/pytest-cov-2.2.1/src/pytest_cov.egg-info/PKG-INFO 2016-01-30
10:04:10.000000000 +0100
+++ new/pytest-cov-2.3.0/src/pytest_cov.egg-info/PKG-INFO 2016-07-05
21:54:48.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest-cov
-Version: 2.2.1
+Version: 2.3.0
Summary: Pytest plugin for measuring coverage.
Home-page: https://github.com/pytest-dev/pytest-cov
Author: Marc Schlaich
@@ -105,7 +105,7 @@
Centralised Testing
-------------------
- Centralised testing will report on the combined coverage of the main
process and all of it's
+ Centralised testing will report on the combined coverage of the main
process and all of its
subprocesses.
Running centralised testing::
@@ -129,7 +129,7 @@
Distributed testing with dist mode set to load will report on the
combined coverage of all slaves.
The slaves may be spread out over any number of hosts and each slave
may be located anywhere on the
- file system. Each slave will have it's subprocesses measured.
+ file system. Each slave will have its subprocesses measured.
Running distributed testing with dist mode set to load::
@@ -231,6 +231,21 @@
--------------------------------------------------
TOTAL 353 20 94%
+ The terminal report with skip covered::
+
+ py.test --cov-report term:skip-covered --cov=myproj tests/
+
+ -------------------- coverage: platform linux2, python
2.6.4-final-0 ---------------------
+ Name Stmts Miss Cover
+ ----------------------------------------
+ myproj/myproj 257 13 94%
+ myproj/feature4286 94 7 92%
+ ----------------------------------------
+ TOTAL 353 20 94%
+
+ 1 files skipped due to complete coverage.
+
+ You can use ``skip-covered`` with ``term-missing`` as well. e.g.
``--cov-report term-missing:skip-covered``
These three report options output to files without showing anything on
the terminal::
@@ -239,6 +254,15 @@
--cov-report annotate
--cov=myproj tests/
+ The output location for each of these reports can be specified. The
output location for the XML
+ report is a file. Where as the output location for the HTML and
annotated source code reports are
+ directories::
+
+ py.test --cov-report html:cov_html
+ --cov-report xml:cov.xml
+ --cov-report annotate:cov_annotate
+ --cov=myproj tests/
+
The final report option can also suppress printing to the terminal::
py.test --cov-report= --cov=myproj tests/
@@ -278,7 +302,7 @@
For full details refer to the `coverage config file`_ documentation.
- .. _`coverage config file`:
http://nedbatchelder.com/code/coverage/config.html
+ .. _`coverage config file`:
https://coverage.readthedocs.io/en/latest/config.html
Note that this plugin controls some options and setting the option in
the config file will have no
effect. These include specifying source to be measured (source
option) and all data file handling
@@ -316,6 +340,20 @@
Changelog
=========
+ 2.3.0 (2016-07-05)
+ ------------------
+
+ * Add support for specifying output location for html, xml, and
annotate report.
+ Contributed by Patrick Lannigan in `PR#113
<https://github.com/pytest-dev/pytest-cov/pull/113>`_.
+ * Fix bug hiding test failure when cov-fail-under failed.
+ * For coverage >= 4.0, match the default behaviour of `coverage
report` and
+ error if coverage fails to find the source instead of just printing
a warning.
+ Contributed by David Szotten in `PR#116
<https://github.com/pytest-dev/pytest-cov/pull/116>`_.
+ * Fixed bug occurred when bare ``--cov`` parameter was used with xdist.
+ Contributed by Michael Elovskikh in `PR#120
<https://github.com/pytest-dev/pytest-cov/pull/120>`_.
+ * Add support for ``skip_covered`` and added
``--cov-report=term-skip-covered`` command
+ line options. Contributed by Saurabh Kumar in `PR#115
<https://github.com/pytest-dev/pytest-cov/pull/115>`_.
+
2.2.1 (2016-01-30)
------------------
@@ -361,18 +399,20 @@
Keywords: cover,coverage,pytest,py.test,distributed,parallel
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
+Classifier: Framework :: Pytest
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
-Classifier: Operating System :: Unix
-Classifier: Operating System :: POSIX
Classifier: Operating System :: Microsoft :: Windows
+Classifier: Operating System :: POSIX
+Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.6
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
+Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
-Classifier: Topic :: Utilities
Classifier: Topic :: Software Development :: Testing
+Classifier: Topic :: Utilities
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/src/pytest_cov.egg-info/SOURCES.txt
new/pytest-cov-2.3.0/src/pytest_cov.egg-info/SOURCES.txt
--- old/pytest-cov-2.2.1/src/pytest_cov.egg-info/SOURCES.txt 2016-01-30
10:04:10.000000000 +0100
+++ new/pytest-cov-2.3.0/src/pytest_cov.egg-info/SOURCES.txt 2016-07-05
21:54:49.000000000 +0200
@@ -36,6 +36,7 @@
src/pytest-cov.embed
src/pytest-cov.pth
src/pytest_cov/__init__.py
+src/pytest_cov/compat.py
src/pytest_cov/embed.py
src/pytest_cov/engine.py
src/pytest_cov/plugin.py
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/tests/test_pytest_cov.py
new/pytest-cov-2.3.0/tests/test_pytest_cov.py
--- old/pytest-cov-2.2.1/tests/test_pytest_cov.py 2016-01-30
10:00:17.000000000 +0100
+++ new/pytest-cov-2.3.0/tests/test_pytest_cov.py 2016-06-20
21:48:45.000000000 +0200
@@ -8,7 +8,7 @@
import py
import pytest
import virtualenv
-from process_tests import TestProcess
+from process_tests import TestProcess as _TestProcess
from process_tests import dump_on_error
from process_tests import wait_for_strings
@@ -99,6 +99,29 @@
pass
'''
+SCRIPT_PARENT_CHANGE_CWD_IMPORT_CHILD = '''
+import subprocess
+import sys
+import os
+
+def pytest_generate_tests(metafunc):
+ for i in range(2):
+ metafunc.addcall(funcargs=dict(idx=i))
+
+def test_foo(idx):
+ os.mkdir("foobar")
+ os.chdir("foobar")
+
+ subprocess.check_call([
+ sys.executable,
+ '-c', 'import sys; sys.argv = ["", str(%s)]; import child_script' % idx
+ ])
+
+# there is a issue in coverage.py with multiline statements at
+# end of file: https://bitbucket.org/ned/coveragepy/issue/293
+pass
+'''
+
SCRIPT_FUNCARG = '''
import coverage
@@ -134,6 +157,8 @@
SCRIPT2_RESULT = '3 * 100%'
CHILD_SCRIPT_RESULT = '[56] * 100%'
PARENT_SCRIPT_RESULT = '8 * 100%'
+DEST_DIR = 'cov_dest'
+REPORT_NAME = 'cov.xml'
xdist = pytest.mark.parametrize('opts', ['', '-n 1'], ids=['nodist', 'xdist'])
@@ -170,6 +195,96 @@
assert result.ret == 0
+def test_annotate_output_dir(testdir):
+ script = testdir.makepyfile(SCRIPT)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=annotate:' + DEST_DIR,
+ script)
+
+ result.stdout.fnmatch_lines([
+ '*- coverage: platform *, python * -*',
+ 'Coverage annotated source written to dir ' + DEST_DIR,
+ '*10 passed*',
+ ])
+ dest_dir = testdir.tmpdir.join(DEST_DIR)
+ assert dest_dir.check(dir=True)
+ assert dest_dir.join(script.basename + ",cover").check()
+ assert result.ret == 0
+
+
+def test_html_output_dir(testdir):
+ script = testdir.makepyfile(SCRIPT)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=html:' + DEST_DIR,
+ script)
+
+ result.stdout.fnmatch_lines([
+ '*- coverage: platform *, python * -*',
+ 'Coverage HTML written to dir ' + DEST_DIR,
+ '*10 passed*',
+ ])
+ dest_dir = testdir.tmpdir.join(DEST_DIR)
+ assert dest_dir.check(dir=True)
+ assert dest_dir.join("index.html").check()
+ assert result.ret == 0
+
+
+def test_xml_output_dir(testdir):
+ script = testdir.makepyfile(SCRIPT)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=xml:' + REPORT_NAME,
+ script)
+
+ result.stdout.fnmatch_lines([
+ '*- coverage: platform *, python * -*',
+ 'Coverage XML written to file ' + REPORT_NAME,
+ '*10 passed*',
+ ])
+ assert testdir.tmpdir.join(REPORT_NAME).check()
+ assert result.ret == 0
+
+
+def test_term_output_dir(testdir):
+ script = testdir.makepyfile(SCRIPT)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term:' + DEST_DIR,
+ script)
+
+ # backport of argparse to py26 doesn't display ArgumentTypeError message
+ result.stderr.fnmatch_lines([
+ '*argument --cov-report: *',
+ ] if tuple(sys.version_info[:2]) == (2, 6) else [
+ '*argument --cov-report: output specifier not supported for:
"term:%s"*' % DEST_DIR,
+ ])
+ assert result.ret != 0
+
+
+def test_term_missing_output_dir(testdir):
+ script = testdir.makepyfile(SCRIPT)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=term-missing:' + DEST_DIR,
+ script)
+
+ # backport of argparse to py26 doesn't display ArgumentTypeError message
+ result.stderr.fnmatch_lines([
+ '*argument --cov-report: *',
+ ] if tuple(sys.version_info[:2]) == (2, 6) else [
+ '*argument --cov-report: output specifier not supported for: '
+ '"term-missing:%s"*' % DEST_DIR,
+ ])
+ assert result.ret != 0
+
+
def test_cov_min_100(testdir):
script = testdir.makepyfile(SCRIPT)
@@ -304,6 +419,20 @@
result.stdout.fnmatch_lines(['*1 failed*'])
+def test_cov_and_failure_report_on_fail(testdir):
+ script = testdir.makepyfile(SCRIPT + SCRIPT_FAIL)
+
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-fail-under=100',
+ script)
+
+ assert 'coverage: platform' in result.stdout.str()
+ assert 'FAIL Required test coverage of 100% not reached' in
result.stdout.str()
+ assert 'assert False' in result.stdout.str()
+ result.stdout.fnmatch_lines(['*10 failed*'])
+
+
def test_dist_combine_racecondition(testdir):
script = testdir.makepyfile("""
import pytest
@@ -414,6 +543,31 @@
assert result.ret == 0
+def test_central_subprocess_change_cwd_with_pythonpath(testdir, monkeypatch):
+ stuff = testdir.mkdir('stuff')
+ parent_script = stuff.join('parent_script.py')
+ parent_script.write(SCRIPT_PARENT_CHANGE_CWD_IMPORT_CHILD)
+ stuff.join('child_script.py').write(SCRIPT_CHILD)
+ testdir.makefile('', coveragerc="""
+[run]
+branch = true
+parallel = true
+""")
+
+ monkeypatch.setitem(os.environ, 'PYTHONPATH', str(stuff))
+ result = testdir.runpytest('-vv', '-s',
+ '--cov=child_script',
+ '--cov-config=coveragerc',
+ '--cov-report=term-missing',
+ parent_script)
+
+ result.stdout.fnmatch_lines([
+ '*- coverage: platform *, python * -*',
+ '*child_script* %s*' % CHILD_SCRIPT_RESULT,
+ ])
+ assert result.ret == 0
+
+
def test_central_subprocess_no_subscript(testdir):
script = testdir.makepyfile("""
import subprocess, sys
@@ -487,7 +641,7 @@
assert result.ret == 0
-def test_empty_report(testdir):
+def test_invalid_coverage_source(testdir):
script = testdir.makepyfile(SCRIPT)
result = testdir.runpytest('-v',
@@ -496,10 +650,22 @@
script)
result.stdout.fnmatch_lines([
- '*- coverage: platform *, python * -*',
'*10 passed*'
])
- assert result.ret == 0
+ result.stderr.fnmatch_lines([
+ 'Coverage.py warning: No data was collected.'
+ ])
+
+ if StrictVersion(coverage.__version__) <= StrictVersion("3.8"):
+ # older `coverage report` doesn't error on missing imports
+ assert result.ret == 0
+ else:
+ # newer `coverage report` errors on missing importts
+ result.stderr.fnmatch_lines([
+ 'ERROR: Failed to generate report: No data to report.',
+ ])
+ assert result.ret != 0
+
matching_lines = [line for line in result.outlines if '%' in line]
assert not matching_lines
@@ -621,7 +787,7 @@
testdir.makeconftest(CONFTEST)
script = testdir.makepyfile(BASIC_TEST)
- monkeypatch.setattr(testdir, 'run', lambda *args: TestProcess(*map(str,
args)))
+ monkeypatch.setattr(testdir, 'run', lambda *args: _TestProcess(*map(str,
args)))
with testdir.runpytest('-v',
'--cov=%s' % script.dirpath(),
'--looponfail',
@@ -698,6 +864,52 @@
['test_coveragerc_dist* %s' % EXCLUDED_RESULT])
+SKIP_COVERED_COVERAGERC = '''
+[report]
+skip_covered = True
+
+'''
+
+SKIP_COVERED_TEST = '''
+
+def func():
+ return "full coverage"
+
+def test_basic():
+ assert func() == "full coverage"
+
+'''
+
+SKIP_COVERED_RESULT = '1 file skipped due to complete coverage.'
+
+
[email protected]('StrictVersion(coverage.__version__) <
StrictVersion("4.0")')
[email protected]('report_option', [
+ 'term-missing:skip-covered',
+ 'term:skip-covered'])
+def test_skip_covered_cli(testdir, report_option):
+ testdir.makefile('', coveragerc=SKIP_COVERED_COVERAGERC)
+ script = testdir.makepyfile(SKIP_COVERED_TEST)
+ result = testdir.runpytest('-v',
+ '--cov=%s' % script.dirpath(),
+ '--cov-report=%s' % report_option,
+ script)
+ assert result.ret == 0
+ result.stdout.fnmatch_lines([SKIP_COVERED_RESULT])
+
+
[email protected]('StrictVersion(coverage.__version__) <
StrictVersion("4.0")')
+def test_skip_covered_coveragerc_config(testdir):
+ testdir.makefile('', coveragerc=SKIP_COVERED_COVERAGERC)
+ script = testdir.makepyfile(SKIP_COVERED_TEST)
+ result = testdir.runpytest('-v',
+ '--cov-config=coveragerc',
+ '--cov=%s' % script.dirpath(),
+ script)
+ assert result.ret == 0
+ result.stdout.fnmatch_lines([SKIP_COVERED_RESULT])
+
+
CLEAR_ENVIRON_TEST = '''
import os
@@ -746,9 +958,26 @@
assert result.ret == 0
[email protected]('sys.platform == "win32"')
+def test_dist_bare_cov(testdir):
+ script = testdir.makepyfile(SCRIPT_SIMPLE)
+
+ result = testdir.runpytest('-v',
+ '--cov',
+ '-n', '1',
+ script)
+
+ result.stdout.fnmatch_lines([
+ '*- coverage: platform *, python * -*',
+ 'test_dist_bare_cov* %s*' % SCRIPT_SIMPLE_RESULT,
+ '*1 passed*'
+ ])
+ assert result.ret == 0
+
+
def test_not_started_plugin_does_not_fail(testdir):
plugin = pytest_cov.plugin.CovPlugin(None, None, start=False)
- plugin.pytest_sessionfinish(None, None)
+ plugin.pytest_runtestloop(None)
plugin.pytest_terminal_summary(None)
@@ -876,4 +1105,3 @@
'test_1* 0%',
'test_2* %s*' % SCRIPT2_RESULT,
])
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/pytest-cov-2.2.1/tox.ini new/pytest-cov-2.3.0/tox.ini
--- old/pytest-cov-2.2.1/tox.ini 2016-01-21 09:16:45.000000000 +0100
+++ new/pytest-cov-2.3.0/tox.ini 2016-06-01 11:13:08.000000000 +0200
@@ -3,7 +3,7 @@
[tox]
envlist =
check,
- {py26,py27,py33,py34,py35,pypy}-{27,28}-{37,40,41},
+ {py26,py27,py33,py34,py35,pypy}-{27,28,29}-{37,40,41},
docs
[testenv]
@@ -22,13 +22,14 @@
*
deps =
27: pytest==2.7.3
- 28: pytest==2.8.5
+ 28: pytest==2.8.7
+ 29: pytest==2.9.2
pytest-capturelog
37: coverage==3.7.1
40: coverage==4.0.3
- 41: coverage==4.1b2
+ 41: coverage==4.1
virtualenv
- pytest-xdist==1.13.1
+ pytest-xdist==1.14
27: pytest-cache==1.0.0
process-tests==1.2.0
pip_pre = true