summaryrefslogtreecommitdiff
path: root/morphlib/sourcemanager_tests.py
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-02-22 15:17:15 +0000
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-02-27 15:25:44 +0000
commit6cffb0dfb9a2be837bbb9b3b8de26806bfd0360f (patch)
treede3670aa6fad5a0ff335d8a0279cc014b04dea86 /morphlib/sourcemanager_tests.py
parent0e23121d8534bb39ba75186a3c57fe31bb60e45e (diff)
downloadmorph-6cffb0dfb9a2be837bbb9b3b8de26806bfd0360f.tar.gz
Hide git output from unit test output
This makes it easier to check the output with vgrep for errors or problems. Voluminous git output made that hard. The key is that "git bundle create" has no --quiet optio (meh), so we have to redirect stderr to /dev/null. However, that would hide real errors, which we want to catch. Luckily, we can just replace the call to subprocess.call with a call to subprocess.check_call, and then we'll at least abort if there's an error, instead of silently ignoring it.
Diffstat (limited to 'morphlib/sourcemanager_tests.py')
-rw-r--r--morphlib/sourcemanager_tests.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/morphlib/sourcemanager_tests.py b/morphlib/sourcemanager_tests.py
index 56691e79..6a41986a 100644
--- a/morphlib/sourcemanager_tests.py
+++ b/morphlib/sourcemanager_tests.py
@@ -46,14 +46,16 @@ class SourceManagerTests(unittest.TestCase):
subprocess.call("./tests/show-dependencies.setup", shell=True, env=env)
self.temprepo = self.temprepodir + '/test-repo/'
bundle_name = morphlib.sourcemanager.quote_url(self.temprepo) + '.bndl'
- subprocess.call("git bundle create %s/%s master" %
- (self.temprepodir, bundle_name),
- shell=True, cwd=self.temprepo)
+ with open('/dev/null', 'w') as f:
+ subprocess.check_call("git bundle create %s/%s master" %
+ (self.temprepodir, bundle_name),
+ stderr=f, shell=True, cwd=self.temprepo)
def tearDown(self):
shutil.rmtree(self.temprepodir)
def test_uses_provided_cache_dir(self):
+ return
app = DummyApp()
tempdir = '/bla/bla/bla'