"M.Kustova" <m...@catit.be> writes: > On Tue, Aug 19, 2014 at 1:44 PM, Fam Zheng <f...@redhat.com> wrote: >> On Tue, 08/19 02:00, Maria Kustova wrote: [...] >>> diff --git a/tests/image-fuzzer/runner.py b/tests/image-fuzzer/runner.py >>> index fd97c40..b142577 100755 >>> --- a/tests/image-fuzzer/runner.py >>> +++ b/tests/image-fuzzer/runner.py [...] >>> @@ -279,29 +277,30 @@ class TestEnv(object): >>> "Backing file: %s\n" \ >>> % (self.seed, " ".join(current_cmd), >>> self.current_dir, backing_file_name) >>> - >>> temp_log = StringIO.StringIO() >>> try: >>> retcode = run_app(temp_log, current_cmd) >>> except OSError, e: >>> - multilog(test_summary + "Error: Start of '%s' failed. " \ >>> - "Reason: %s\n\n" % (os.path.basename( >>> - current_cmd[0]), e[1]), >>> + multilog(test_summary + >>> + ("Error: Start of '%s' failed. Reason: %s\n\n" >>> + % (os.path.basename(current_cmd[0]), e[1])), >> >> I prefer the old one. I don't like the special case in python syntax: '(val)' >> is just val, but '(val1, val2)' is a tuple. > > This 'tuple' format provides that '%' substitution will be applied > only to the string in the parentheses, > instead of an entire string (in this case including test summary). > The same rationale for cases below.
What about something like multilog("%sError: Start of '%s' failed. Reason: %s\n\n" % (test_summary, os.path.basename(current_cmd[0]), e[1]), sys.stderr, self.log, self.parent_log) [...]