diff options
| author | Martin <gzlist@googlemail.com> | 2011-04-27 02:25:24 +0100 |
|---|---|---|
| committer | Martin <gzlist@googlemail.com> | 2011-04-27 02:25:24 +0100 |
| commit | a9af4250b0eeaf9b45a6e25a59736efffe1d46fd (patch) | |
| tree | d85962660bbb286383d4e91431cab2ddfab07242 /python/subunit/__init__.py | |
| parent | e0fe5856dce0725841d54b6be2c3c8d70f89a0b5 (diff) | |
| download | subunit-a9af4250b0eeaf9b45a6e25a59736efffe1d46fd.tar.gz | |
Hack ExecTestCase and its tests to sort-of be portable fixing the remaing spew
Diffstat (limited to 'python/subunit/__init__.py')
| -rw-r--r-- | python/subunit/__init__.py | 8 |
1 files changed, 6 insertions, 2 deletions
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)) |
