From a700c261ef45c4378ccfb10df6ce64255196b8ff Mon Sep 17 00:00:00 2001 From: fijal Date: Tue, 18 Mar 2008 21:57:43 +0100 Subject: [PATCH] [svn r52707] Allow some mocking. --HG-- branch : trunk --- py/test/reporter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/py/test/reporter.py b/py/test/reporter.py index 4166896a0..fcb2acdb6 100644 --- a/py/test/reporter.py +++ b/py/test/reporter.py @@ -49,12 +49,15 @@ class TestReporter(object): return self.flag class AbstractReporter(object): - def __init__(self, config, hosts): + def __init__(self, config, hosts, out=None): self.config = config self.hosts = hosts self.failed_tests_outcome = [] self.skipped_tests_outcome = [] - self.out = getout(py.std.sys.stdout) + if out is None: + self.out = getout(py.std.sys.stdout) + else: + self.out = out self.presenter = Presenter(self.out, config) self.to_rsync = {}