Bug 1414958 - Better handle Unicode in `mach python-test`
I suspect this will yield a failure in self.log() on line 199. But
I want to make sure before I ask for review.
MozReview-Commit-ID: FSvS7r9wL4q
--- a/python/mach_commands.py
+++ b/python/mach_commands.py
@@ -203,18 +203,18 @@ class MachCommands(MachCommandBase):
def _line_handler(line):
if not file_displayed_test:
output = ('Ran' in line or 'collected' in line or
line.startswith('TEST-'))
if output:
file_displayed_test.append(True)
# Hack to make sure treeherder highlights pytest failures
- if 'FAILED' in line.rsplit(' ', 1)[-1]:
- line = line.replace('FAILED', 'TEST-UNEXPECTED-FAIL')
+ if b'FAILED' in line.rsplit(b' ', 1)[-1]:
+ line = line.replace(b'FAILED', b'TEST-UNEXPECTED-FAIL')
_log(line)
_log(test_path)
cmd = [self.virtualenv_manager.python_path, test_path]
env = os.environ.copy()
env[b'PYTHONDONTWRITEBYTECODE'] = b'1'