Skip to content

Commit ef7e9ae

Browse files
committed
Fix coverage to sum all coverage across versions
This means any code that is Py2 or Py3 only is counted properly in coverage reports
1 parent 2d9670f commit ef7e9ae

4 files changed

Lines changed: 14 additions & 8 deletions

File tree

cfn_resource.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ def wrapper_func(event, context):
5757
logger.info("Responding to '%s' request with: %s" % (
5858
event['RequestType'], serialized))
5959

60-
if sys.version_info.major ==3:
60+
if sys.version_info.major == 3:
6161
req_data = serialized.encode('utf-8')
6262
else:
63-
req_data=serialized
63+
req_data = serialized
6464
req = Request(
6565
event['ResponseURL'], data=req_data,
6666
headers={'Content-Length': len(req_data),

pytest.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
[pytest]
22
looponfailroots = .
3-
addopts = --cov-config .coveragerc --cov .
4-
#addopts = --cov . --cov-report=html -f
3+
#addopts = -f

test-requirements.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
mock
22
vcrpy
33
pytest
4-
pytest-cov
5-
pytest-xdist
4+
coverage>=4.2

tox.ini

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
[tox]
2-
envlist = py27,py36
2+
envlist = py27,py36,coverage-report
33

44
[testenv]
55
deps = -rtest-requirements.txt
6-
commands = pytest {posargs}
6+
commands = coverage run --parallel -m pytest {posargs}
7+
8+
[testenv:coverage-report]
9+
deps = coverage
10+
skip_install = true
11+
commands =
12+
coverage combine
13+
coverage html
14+
coverage report

0 commit comments

Comments
 (0)