aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEmma Foley <emma.l.foley@intel.com>2018-06-26 09:30:47 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-06-26 09:30:47 +0000
commit53e84f535ca03e7aabb902e8f21a77171fe40c1b (patch)
treed7949009f9448356a1cee489dbde7c61643f0524
parentd2c984e806eac4c981eec95626884c48eb699299 (diff)
parent87fdd3f5135639de4e65b66fa67bc5d04b486f25 (diff)
Merge "Remove instantiated contexts in "test_task"" into stable/fraser
-rw-r--r--yardstick/tests/unit/benchmark/core/test_task.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/yardstick/tests/unit/benchmark/core/test_task.py b/yardstick/tests/unit/benchmark/core/test_task.py
index 9e8e4e9f7..e7d2c70b7 100644
--- a/yardstick/tests/unit/benchmark/core/test_task.py
+++ b/yardstick/tests/unit/benchmark/core/test_task.py
@@ -357,6 +357,11 @@ key2:
}
}
+ @staticmethod
+ def _remove_context(context):
+ if context:
+ context._delete_context()
+
def test__change_node_names(self):
ctx_attrs = {
@@ -371,6 +376,7 @@ key2:
}
my_context = dummy.DummyContext()
+ self.addCleanup(self._remove_context, my_context)
my_context.init(ctx_attrs)
expected_scenario = {
@@ -413,6 +419,7 @@ key2:
}
my_context = dummy.DummyContext()
+ self.addCleanup(self._remove_context, my_context)
my_context.init(ctx_attrs)
scenario = copy.deepcopy(self.scenario)
@@ -428,6 +435,7 @@ key2:
}
my_context = dummy.DummyContext()
+ self.addCleanup(self._remove_context, my_context)
my_context.init(ctx_attrs)
scenario = copy.deepcopy(self.scenario)
scenario['options'] = None
@@ -442,6 +450,7 @@ key2:
}
my_context = dummy.DummyContext()
+ self.addCleanup(self._remove_context, my_context)
my_context.init(ctx_attrs)
scenario = copy.deepcopy(self.scenario)
scenario['options']['server_name'] = None