summaryrefslogtreecommitdiffhomepage
path: root/tests/14_test_gbp_import_dscs.py
diff options
context:
space:
mode:
authorThomas Koch <thomas@koch.ro>2013-01-21 15:50:39 +0100
committerGuido Günther <agx@sigxcpu.org>2013-04-08 07:43:02 +0200
commit3d6b68ae541d6020ff747628b3e44196999e0a50 (patch)
treebb3f94d4f9c0af6eb3a9779dbf6bbee20a512ef0 /tests/14_test_gbp_import_dscs.py
parent92edb4eda14cf4b5fd1514feb7b81aa50456285c (diff)
tests: Use tempfile.mkdtemp to create temp dirs for tests
This puts test dirs below /tmp which often is a tmpfs. All tests include the context module which consolidates tmpdir creation and cleanup, undoes a chdir in teardown and silences log messages.
Diffstat (limited to 'tests/14_test_gbp_import_dscs.py')
-rw-r--r--tests/14_test_gbp_import_dscs.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/14_test_gbp_import_dscs.py b/tests/14_test_gbp_import_dscs.py
index 1525ae9e..694d67ef 100644
--- a/tests/14_test_gbp_import_dscs.py
+++ b/tests/14_test_gbp_import_dscs.py
@@ -15,6 +15,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
"""Test L{gbp.pq}"""
+from . import context
+
import os
import testutils
import gbp.scripts.import_dscs as import_dscs
@@ -58,9 +60,8 @@ class TestImportDscs(testutils.DebianGitTestRepo):
"""Test L{gbp.scripts.import_dscs}'s """
def setUp(self):
- self.toplevel = os.getcwd()
testutils.DebianGitTestRepo.setUp(self)
- os.chdir(self.repo.path)
+ context.chdir(self.repo.path)
def test_import_success(self):
"""Test importing success with stub"""
@@ -83,5 +84,5 @@ class TestImportDscs(testutils.DebianGitTestRepo):
def tearDown(self):
testutils.DebianGitTestRepo.tearDown(self)
- os.chdir(self.toplevel)
+ context.teardown()