From a9af4250b0eeaf9b45a6e25a59736efffe1d46fd Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 27 Apr 2011 02:25:24 +0100 Subject: Hack ExecTestCase and its tests to sort-of be portable fixing the remaing spew --- python/subunit/__init__.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'python/subunit/__init__.py') diff --git a/python/subunit/__init__.py b/python/subunit/__init__.py index a7048d3..82864f7 100644 --- a/python/subunit/__init__.py +++ b/python/subunit/__init__.py @@ -817,6 +817,8 @@ class ExecTestCase(unittest.TestCase): """ unittest.TestCase.__init__(self, methodName) testMethod = getattr(self, methodName) + # GZ 2011-04-25: Embedding shell commands in docstrings is fragile and + # and may break if the module directory contains spaces self.script = join_dir(sys.modules[self.__class__.__module__].__file__, testMethod.__doc__) @@ -833,8 +835,10 @@ class ExecTestCase(unittest.TestCase): def _run(self, result): protocol = TestProtocolServer(result) - output = subprocess.Popen(self.script, shell=True, - stdout=subprocess.PIPE).communicate()[0] + process = subprocess.Popen(self.script, shell=True, + stdout=subprocess.PIPE) + _make_stream_binary(process.stdout) + output = process.communicate()[0] protocol.readFrom(BytesIO(output)) -- cgit v1.2.1