Don't consider version-specific code for coverage.

(Also add generated coverage reports to .gitignore)

Change-Id: Ide59ffe812d99774e9e4d0d1ad266ab665f02321
This commit is contained in:
Daniel Watkins 2015-07-03 09:40:12 +01:00
parent e10de8835b
commit a09499fc2c
4 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ doc/build
doc/source/api/
ChangeLog
AUTHORS
cover/

View File

@ -39,7 +39,7 @@ class _BlatherLoggerAdapter(logging.LoggerAdapter):
# TODO(harlowja): we should remove when we no longer have to support 2.6...
if sys.version_info[0:2] == (2, 6):
if sys.version_info[0:2] == (2, 6): # pragma: nocover
class _FixedBlatherLoggerAdapter(_BlatherLoggerAdapter):
"""Ensures isEnabledFor() exists on adapters that are created."""

View File

@ -8,7 +8,7 @@ import time
try:
from time import monotonic as now
except ImportError:
except ImportError: # pragma: nocover
from time import time as now
import requests

View File

@ -9,6 +9,6 @@ try:
from pbr import version as pbr_version
_version_info = pbr_version.VersionInfo('cloudinit')
version_string = _version_info.version_string
except ImportError:
except ImportError: # pragma: nocover
_version_info = pkg_resources.get_distribution('cloudinit')
version_string = lambda: _version_info.version