aboutsummaryrefslogtreecommitdiffstats
path: root/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
diff options
context:
space:
mode:
authorRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-14 14:14:27 +0100
committerRodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>2018-06-14 14:29:00 +0100
commit9b22f5b23050a0be67f8237e4d0b412f58b43472 (patch)
tree7b826b06d783b7f79b0eb782913201d228946a9a /yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
parenta3399d07b83ce0e50d9c0144d00a7ba83a73390f (diff)
Stop time.sleep mocks in unit tests
tVpeApproxVnf and TestProxSocketHelper classes mock "time.sleep" in the setUp method without deleting it at the end of the test execution. JIRA: YARDSTICK-1243 Change-Id: Iff31d9c7b400ad8a47f37792aeb0d20328b9d9e1 Signed-off-by: Rodolfo Alonso Hernandez <rodolfo.alonso.hernandez@intel.com>
Diffstat (limited to 'yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py')
-rw-r--r--yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
index c74a6cf75..d9031cdb8 100644
--- a/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
+++ b/yardstick/tests/unit/network_services/vnf_generic/vnf/test_prox_helpers.py
@@ -293,7 +293,12 @@ no data length value
class TestProxSocketHelper(unittest.TestCase):
def setUp(self):
- self.mock_time_sleep = mock.patch.object(time, 'sleep').start()
+ self._mock_time_sleep = mock.patch.object(time, 'sleep')
+ self.mock_time_sleep = self._mock_time_sleep.start()
+ self.addCleanup(self._stop_mocks)
+
+ def _stop_mocks(self):
+ self._mock_time_sleep.stop()
@mock.patch('yardstick.network_services.vnf_generic.vnf.prox_helpers.socket')
def test___init__(self, mock_socket):