Add coverage.py configuration.

This commit is contained in:
Chris PeBenito 2015-02-03 08:08:35 -05:00
parent 2418619e2a
commit 0b2782b0a2
3 changed files with 15 additions and 4 deletions

View File

@ -20,7 +20,7 @@
try:
import pkg_resources
__version__ = pkg_resources.get_distribution("setools").version
except:
except: # pragma: no cover
__version__ = "unknown"
# Python classes for policy representation

View File

@ -18,7 +18,7 @@
#
try:
import ipaddress
except ImportError:
except ImportError: # pragma: no cover
pass
import re
@ -75,7 +75,7 @@ class NodeconQuery(contextquery.ContextQuery):
if self.network:
try:
netmask = ipaddress.ip_address(n.netmask)
except NameError:
except NameError: # pragma: no cover
# Should never actually hit this since the self.network
# setter raises the same exception.
raise RuntimeError(
@ -141,7 +141,7 @@ class NodeconQuery(contextquery.ContextQuery):
if net:
try:
self.network = ipaddress.ip_network(net)
except NameError:
except NameError: # pragma: no cover
raise RuntimeError(
"IP address/network functions require Python 3.3+.")
else:

11
tests/coveragerc Normal file
View File

@ -0,0 +1,11 @@
#coverage.py configuration
[run]
source = setools
# This is SWIG generated:
omit = setools/policyrep/qpol.py
[report]
exclude_lines =
pragma: no cover
def __repr__
raise NotImplementedError