コード例 #1
0
ファイル: test_reporter.py プロジェクト: swayf/doit
    def test_executeTask(self):
        rep = reporter.ZeroReporter(io.StringIO(), {})

        def do_nothing():
            pass

        t1 = Task("with_action", [(do_nothing, )])
        rep.execute_task(t1)
        assert "" == rep.outstream.getvalue()
コード例 #2
0
 def test_runtime_error(self, capsys):
     msg = "zero runtime error"
     rep = reporter.ZeroReporter(StringIO(), {})
     # imediate output
     rep.runtime_error(msg)
     assert msg in capsys.readouterr()[1]