Merge ~pappacena/turnip:py3-func-test-cmd-output into turnip:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: be93583b833f60cbd552b524812b1728da4cb234
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/turnip:py3-func-test-cmd-output
Merge into: turnip:master
Diff against target: 25 lines (+4/-4)
1 file modified
turnip/pack/tests/test_functional.py (+4/-4)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+391235@code.launchpad.net

Commit message

Convert command output to text before adding it as test detail

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/turnip/pack/tests/test_functional.py b/turnip/pack/tests/test_functional.py
2index f652a12..c06c4e2 100644
3--- a/turnip/pack/tests/test_functional.py
4+++ b/turnip/pack/tests/test_functional.py
5@@ -158,8 +158,8 @@ class FunctionalTestMixin(WithScenarios):
6 out, err, code = yield utils.getProcessOutputAndValue(
7 command[0], command[1:], env=os.environ, path=path)
8 if code != 0:
9- self.addDetail('stdout', text_content(out))
10- self.addDetail('stderr', text_content(err))
11+ self.addDetail('stdout', text_content(six.ensure_text(out)))
12+ self.addDetail('stderr', text_content(six.ensure_text(err)))
13 self.assertEqual(0, code)
14 defer.returnValue(out)
15
16@@ -173,8 +173,8 @@ class FunctionalTestMixin(WithScenarios):
17 out, err, code = yield utils.getProcessOutputAndValue(
18 command[0], command[1:], env=os.environ, path=path)
19 if code == 0:
20- self.addDetail('stdout', text_content(out))
21- self.addDetail('stderr', text_content(err))
22+ self.addDetail('stdout', text_content(six.ensure_text(out)))
23+ self.addDetail('stderr', text_content(six.ensure_text(err)))
24 self.assertNotEqual(0, code)
25 defer.returnValue((out, err))
26

Subscribers

People subscribed via source and target branches