Xqt has submitted this change and it was merged.
Change subject: [bugfix] use string.splitlines() instead of string.split('\n') ......................................................................
[bugfix] use string.splitlines() instead of string.split('\n')
split('\n') is intended to split line feeds but in some circumstances a remaining CR (\r) was found in the string and comparing always fails in that case. Using splitlines solves this problem.
Change-Id: I30fd90d6c040dd0d25d7f328db0eee3ce45577d7 --- M tests/script_tests.py 1 file changed, 2 insertions(+), 2 deletions(-)
Approvals: Mpaa: Looks good to me, approved Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/script_tests.py b/tests/script_tests.py index 5f9fb85..cc4348c 100644 --- a/tests/script_tests.py +++ b/tests/script_tests.py @@ -272,7 +272,7 @@ result = execute_pwb(cmd, data_in, timeout=timeout, error=error, overrides=test_overrides)
- stderr = result['stderr'].split('\n') + stderr = result['stderr'].splitlines() stderr_sleep = [l for l in stderr if l.startswith('Sleeping for ')] stderr_other = [l for l in stderr @@ -288,7 +288,7 @@
exit_codes = [0, 1, 2, -9] elif not is_autorun: - if stderr_other == ['']: + if stderr_other == []: stderr_other = None if stderr_other is not None: self.assertIn('Use -help for further information.',
pywikibot-commits@lists.wikimedia.org