diff options
author | Donald Stufft <donald@stufft.io> | 2014-11-13 08:17:36 -0500 |
---|---|---|
committer | Donald Stufft <donald@stufft.io> | 2014-11-13 08:17:36 -0500 |
commit | 62143e47077b8df78e926da5c8f027d8f01ab281 (patch) | |
tree | 374a8d414b7c1fdae7d2ff6b81980e541b59ae12 | |
parent | c62a78c015cf7aeb0c05bce82ef14cd86fe0b0fc (diff) | |
download | cryptography-62143e47077b8df78e926da5c8f027d8f01ab281.tar.gz cryptography-62143e47077b8df78e926da5c8f027d8f01ab281.tar.bz2 cryptography-62143e47077b8df78e926da5c8f027d8f01ab281.zip |
Use coverage parallel mode and coverage combine to fix paths
When using coverage.py with a project installed into site-packages
instead of in the current directory you end up with paths like
.tox/py34/lib/python3.4/site-packages/cryptography/__init__.py which
is less than ideal (and may cause issues when aggregating coverage
over multiple versions of Python). Switching coverage.py into
parallel-mode will have it write a .coverage.* file instead of a
.coverage file, which can then be "combined" into a .coverage file
using coverage combine. When coverage.py does the combine step it
will collapse the .tox/*/lib/python*/site-packages/cryptography
paths into src/cryptography.
-rw-r--r-- | .coveragerc | 5 | ||||
-rw-r--r-- | tox.ini | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/.coveragerc b/.coveragerc index aa69fd4f..a0a57b33 100644 --- a/.coveragerc +++ b/.coveragerc @@ -4,6 +4,11 @@ source = cryptography tests/ +[paths] +source = + src/cryptography + .tox/*/lib/python*/site-packages/cryptography + [report] exclude_lines = @abc.abstractmethod @@ -11,7 +11,11 @@ deps = pytest ./vectors commands = - coverage run -m pytest --capture=no --strict {posargs} + # We use parallel mode and then combine here so that coverage.py will take + # the paths like .tox/py34/lib/python3.4/site-packages/cryptography/__init__.py + # and collapse them into src/cryptography/__init__.py. + coverage run --parallel-mode -m pytest --capture=no --strict {posargs} + coverage combine coverage report -m [testenv:docs] |