[lldb/Test] Convert stdout to str by calling decode('utf-8') on it.

Make sure both arguments to assertIn are of type str. This should fix
the following error:

TypeError: a bytes-like object is required, not 'str'.
This commit is contained in:
Jonas Devlieghere 2020-03-13 09:49:00 -07:00
parent 18eae33122
commit 17bdb7a179
1 changed files with 4 additions and 2 deletions

View File

@ -53,7 +53,8 @@ class CreateAfterAttachTestCase(TestBase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
outs, errs = capture.communicate()
outs, _ = capture.communicate()
outs = outs.decode('utf-8')
self.assertIn('Process {} stopped'.format(pid), outs)
self.assertIn('Reproducer written', outs)
@ -63,7 +64,8 @@ class CreateAfterAttachTestCase(TestBase):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
outs, errs = replay.communicate()
outs, _ = replay.communicate()
outs = outs.decode('utf-8')
self.assertIn('Process {} stopped'.format(pid), outs)
# We can dump the reproducer in the current context.