Remove pragma no cover from code

Add exclude_lines in the report section of .coveragerc to ignore
abstract in test coverage

Change-Id: I7863a8ba7e20358fb7cdf3cc7e4d83871a5104ef
This commit is contained in:
Jean-Emile DARTOIS 2015-12-08 15:05:52 +01:00
parent 7c72d6f912
commit 57cecb27f5
15 changed files with 21 additions and 37 deletions
.coveragerc
watcher
applier
action_plan
base.py
mapping
primitives
decision_engine
metrics_engine
cluster_history
cluster_model_collector

@ -5,3 +5,5 @@ omit = watcher/tests/*
[report] [report]
ignore_errors = True ignore_errors = True
exclude_lines =
@abstract

@ -25,5 +25,4 @@ import six
class BaseActionPlanHandler(object): class BaseActionPlanHandler(object):
@abc.abstractmethod @abc.abstractmethod
def execute(self): def execute(self):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -25,5 +25,4 @@ import six
class BaseApplier(object): class BaseApplier(object):
@abc.abstractmethod @abc.abstractmethod
def execute(self, action_plan_uuid): def execute(self, action_plan_uuid):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -30,5 +30,4 @@ class BaseActionMapper(object):
:type action: watcher.decision_engine.action.BaseAction :type action: watcher.decision_engine.action.BaseAction
:return: the associated Primitive :return: the associated Primitive
""" """
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -26,11 +26,9 @@ class BasePrimitive(object):
@Promise @Promise
@abc.abstractmethod @abc.abstractmethod
def execute(self): def execute(self):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover
@Promise @Promise
@abc.abstractmethod @abc.abstractmethod
def undo(self): def undo(self):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -24,5 +24,4 @@ import six
class BaseDecisionEngineCommand(object): class BaseDecisionEngineCommand(object):
@abc.abstractmethod @abc.abstractmethod
def execute(self): def execute(self):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -36,4 +36,4 @@ class BaseEventConsumer(object):
@abc.abstractmethod @abc.abstractmethod
def execute(self, request_id, context, data): def execute(self, request_id, context, data):
raise NotImplementedError('Not implemented ...') # pragma:no cover raise NotImplementedError()

@ -33,5 +33,4 @@ class BasePlanner(object):
and performance requirements are met. and performance requirements are met.
""" """
# example: directed acyclic graph # example: directed acyclic graph
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -53,10 +53,8 @@ class BaseSolution(object):
@abc.abstractmethod @abc.abstractmethod
def add_change_request(self, r): def add_change_request(self, r):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover
@abc.abstractproperty @abc.abstractproperty
def actions(self): def actions(self):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -24,5 +24,4 @@ import six
class BaseSolutionComparator(object): class BaseSolutionComparator(object):
@abc.abstractmethod @abc.abstractmethod
def compare(self, sol1, sol2): def compare(self, sol1, sol2):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -24,5 +24,4 @@ import six
class BaseSolutionEvaluator(object): class BaseSolutionEvaluator(object):
@abc.abstractmethod @abc.abstractmethod
def evaluate(self, solution): def evaluate(self, solution):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -24,5 +24,4 @@ import six
class BaseStrategyContext(object): class BaseStrategyContext(object):
@abc.abstractmethod @abc.abstractmethod
def execute_strategy(self, model): def execute_strategy(self, model):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -24,5 +24,4 @@ import six
class BaseSelector(object): class BaseSelector(object):
@abc.abstractmethod @abc.abstractmethod
def define_from_goal(self, goal_name): def define_from_goal(self, goal_name):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma:no cover

@ -27,18 +27,14 @@ class BaseClusterHistory(object):
@abc.abstractmethod @abc.abstractmethod
def statistic_aggregation(self, resource_id, meter_name, period, def statistic_aggregation(self, resource_id, meter_name, period,
aggregate='avg'): aggregate='avg'):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma: nocover
@abc.abstractmethod @abc.abstractmethod
def get_last_sample_values(self, resource_id, meter_name, limit=1): def get_last_sample_values(self, resource_id, meter_name, limit=1):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma: nocover
def query_sample(self, meter_name, query, limit=1): def query_sample(self, meter_name, query, limit=1):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma: nocover
def statistic_list(self, meter_name, query=None, period=None): def statistic_list(self, meter_name, query=None, period=None):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma: nocover

@ -24,5 +24,4 @@ import six
class BaseClusterModelCollector(object): class BaseClusterModelCollector(object):
@abc.abstractmethod @abc.abstractmethod
def get_latest_cluster_data_model(self): def get_latest_cluster_data_model(self):
raise NotImplementedError( raise NotImplementedError()
"Should have implemented this") # pragma: nocover