From 556ac5660c22eb8316bff03cc3ccec5c82005b7c Mon Sep 17 00:00:00 2001 From: "Chris St. Pierre" Date: Tue, 21 Aug 2012 17:06:35 -0400 Subject: removed context managers from unit tests --- testsuite/Testlib/TestServer/TestPlugins/TestMetadata.py | 1 - testsuite/Testlib/TestServer/TestPlugins/TestProbes.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'testsuite/Testlib/TestServer/TestPlugins') diff --git a/testsuite/Testlib/TestServer/TestPlugins/TestMetadata.py b/testsuite/Testlib/TestServer/TestPlugins/TestMetadata.py index 7382a4439..5dcd84a0c 100644 --- a/testsuite/Testlib/TestServer/TestPlugins/TestMetadata.py +++ b/testsuite/Testlib/TestServer/TestPlugins/TestMetadata.py @@ -3,7 +3,6 @@ import sys import copy import time import socket -import unittest import lxml.etree from mock import Mock, patch from ....common import * diff --git a/testsuite/Testlib/TestServer/TestPlugins/TestProbes.py b/testsuite/Testlib/TestServer/TestPlugins/TestProbes.py index df9248e50..38161215d 100644 --- a/testsuite/Testlib/TestServer/TestPlugins/TestProbes.py +++ b/testsuite/Testlib/TestServer/TestPlugins/TestProbes.py @@ -1,7 +1,6 @@ import os import sys import time -import unittest import lxml.etree from mock import Mock, MagicMock, patch from ....common import * @@ -228,9 +227,11 @@ text # test__init(), which relies on being able to check the calls # of load_data(), and thus on load_data() being consistently # mocked) - with patch("Bcfg2.Server.Plugins.Probes.Probes.load_data", - new=load_data): + @patch("Bcfg2.Server.Plugins.Probes.Probes.load_data", new=load_data) + def inner(): return Probes(core, datastore) + + return inner() def test__init(self): mock_load_data = Mock() -- cgit v1.2.3-1-g7c22