aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2017-07-18 21:37:46 +0200
committerGuido Günther <agx@sigxcpu.org>2017-07-18 21:37:46 +0200
commit62ab1eb839cd429027a3f84433b6b720122f5d25 (patch)
treee5a2245d7a80d3057500486650d778b0f716bbb0
parentaaee8bb0b2bdc9337d16b4c1d9b0b3303f91dd22 (diff)
tests: properly restore import_dscs
so later testcases don't break
-rw-r--r--tests/14_test_gbp_import_dscs.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/14_test_gbp_import_dscs.py b/tests/14_test_gbp_import_dscs.py
index 35b2e38..e86eabc 100644
--- a/tests/14_test_gbp_import_dscs.py
+++ b/tests/14_test_gbp_import_dscs.py
@@ -56,11 +56,6 @@ class DscStub(object):
return cls(filename, version)
-# hook up stubs
-import_dscs.GitImportDsc = StubGitImportDsc
-import_dscs.DscFile = DscStub
-
-
class TestImportDscs(testutils.DebianGitTestRepo):
"""Test L{gbp.scripts.import_dscs}'s """
@@ -70,6 +65,11 @@ class TestImportDscs(testutils.DebianGitTestRepo):
self.orig_err = gbp.log.err
gbp.log.err = self._check_err_msg
+ self.safed_GitImportDsc = import_dscs.GitImportDsc
+ self.safed_DscFile = import_dscs.DscFile
+ import_dscs.GitImportDsc = StubGitImportDsc
+ import_dscs.DscFile = DscStub
+
def _check_err_msg(self, err):
self.assertIsInstance(err, GbpError)
self.assertIn("Failed to import", err.message)
@@ -97,3 +97,6 @@ class TestImportDscs(testutils.DebianGitTestRepo):
gbp.log.err = self.orig_err
testutils.DebianGitTestRepo.tearDown(self)
context.teardown()
+
+ import_dscs.GitImportDsc = self.safed_GitImportDsc
+ import_dscs.DscFile = self.safed_DscFile