mirror of
https://github.com/SELinuxProject/setools
synced 2025-02-19 13:37:04 +00:00
Add coverage.py configuration.
This commit is contained in:
parent
2418619e2a
commit
0b2782b0a2
@ -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
|
||||
|
@ -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
11
tests/coveragerc
Normal 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
|
Loading…
Reference in New Issue
Block a user