Skip to content

Commit 12967e1

Browse files
committed
tests: fix tests on python3 when run from utf-8 path
Use the proven core.run_command() helper to properly handle executing git commands on all supported platforms. This fixes the test suite on python3 when run from within a utf-8 encoded filesystem path. Signed-off-by: David Aguilar <davvid@gmail.com>
1 parent b549392 commit 12967e1

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/helper.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from __future__ import absolute_import, division, unicode_literals
2-
32
import os
43
import shutil
54
import stat
@@ -83,11 +82,9 @@ def setUp(self, commit=True):
8382
gitcmds.reset()
8483

8584
def git(self, *args):
86-
p = subprocess.Popen(['git'] + list(args), stdout=subprocess.PIPE,
87-
stderr=subprocess.PIPE)
88-
output, error = p.communicate()
89-
self.failIf(p.returncode != 0)
90-
return output.strip()
85+
status, out, err = core.run_command(['git'] + list(args))
86+
self.assertEqual(status, 0)
87+
return out
9188

9289
def initialize_repo(self):
9390
self.git('init')

0 commit comments

Comments
 (0)