I've tried to reproduce the issue here. Screenshot:
sonarqube version: 6.7.0.33306
coverage version:
pip freeze | grep coverage -> coverage==3.7.1
pytest output excerpt:
2018-01-09 17:09:46 ============================= test session starts ==============================
2018-01-09 17:09:46 platform linux -- Python 3.5.2, pytest-3.0.7, py-1.5.2, pluggy-0.4.0 -- /usr/bin/python3
2018-01-09 17:09:46 cachedir: .cache
2018-01-09 17:09:46 rootdir: /var/tmp/test_offboard_jenkins, inifile: pytest.ini
2018-01-09 17:09:46 plugins: pyfakefs-3.2, cov-2.5.1, timeout-1.2.0, factoryboy-1.3.1, xdist-1.16.0
2018-01-09 17:09:46 timeout: 300.0s method: signal
...
2018-01-09 17:10:36 platform_eng/coverage/tests/test_canary.py::TestCanary::test_covered_scalar PASSED
2018-01-09 17:10:36 platform_eng/coverage/tests/test_canary.py::TestCanary::test_covered_vector PASSED
...
2018-01-09 17:11:26 Name Stmts Miss Branch BrPart Cover Missing
2018-01-09 17:11:26 ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------
...
2018-01-09 17:11:26 platform_eng/__init__.py 0 0 0 0 100%
2018-01-09 17:11:26 platform_eng/coverage/__init__.py 0 0 0 0 100%
2018-01-09 17:11:26 platform_eng/coverage/canary.py 8 2 0 0 75% 20-24
2018-01-09 17:11:26 platform_eng/coverage/tests/test_canary.py 13 1 2 1 87% 19, 18->19
coverage.xml excerpt:
<class branch-rate="1" complexity="0" filename="platform_eng/coverage/canary.py" line-rate="0.75" name="canary.py">
<methods/>
<lines>
<line hits="1" number="3"/>
<line hits="1" number="6"/>
<line hits="1" number="8"/>
<line hits="1" number="12"/>
<line hits="1" number="16"/>
<line hits="1" number="19"/>
<line hits="0" number="20"/>
<line hits="0" number="24"/>
</lines>
</class>
Please let me know if I can get you any additional context or information.