diff options
author | Thomas Koch <thomas@koch.ro> | 2013-01-21 15:50:39 +0100 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2013-04-08 07:43:02 +0200 |
commit | 3d6b68ae541d6020ff747628b3e44196999e0a50 (patch) | |
tree | bb3f94d4f9c0af6eb3a9779dbf6bbee20a512ef0 /tests/11_test_dch_main.py | |
parent | 92edb4eda14cf4b5fd1514feb7b81aa50456285c (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/11_test_dch_main.py')
-rw-r--r-- | tests/11_test_dch_main.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/11_test_dch_main.py b/tests/11_test_dch_main.py index e43709c3..44498298 100644 --- a/tests/11_test_dch_main.py +++ b/tests/11_test_dch_main.py @@ -2,6 +2,8 @@ """Test L{gbp.scripts.dch} main""" +from . import context + import unittest from tests.testutils import DebianGitTestRepo @@ -48,7 +50,7 @@ class TestScriptDch(DebianGitTestRepo): self.upstream_tag = "upstream/%(version)s" self.top = os.path.abspath(os.path.curdir) os.mkdir(os.path.join(self.repo.path, "debian")) - os.chdir(self.repo.path) + context.chdir(self.repo.path) self.add_file("debian/changelog", cl_debian) self.add_file("debian/control", """Source: test-package\nSection: test\n""") self.options = ["--upstream-tag=%s" % self.upstream_tag, "--debian-branch=debian", @@ -57,7 +59,6 @@ class TestScriptDch(DebianGitTestRepo): def tearDown(self): - os.chdir(self.top) DebianGitTestRepo.tearDown(self) |