Пример #1
0
 def test_failure(self):
     output = StringIO()
     rep = OutdatedReporter(output, None)
     # failures of outdated tasks are expected, so nothing happens
     rep.add_failure(FakeTask("outdated:xxx"), Exception())
     # failures on any other task raise error
     pytest.raises(pytest.UsageError, rep.add_failure, FakeTask("x"), Exception())
Пример #2
0
 def test_failure(self):
     output = StringIO()
     rep = OutdatedReporter(output, None)
     # failures of outdated tasks are expected, so nothing happens
     rep.add_failure(FakeTask('outdated:xxx'), Exception())
     # failures on any other task raise error
     pytest.raises(pytest.UsageError, rep.add_failure, FakeTask('x'),
                   Exception())
Пример #3
0
 def test_output(self):
     output = StringIO()
     rep = OutdatedReporter(output, None)
     rep.execute_task(FakeTask("foo"))
     rep.execute_task(FakeTask("outdated:xxx"))
     rep.execute_task(FakeTask("NOToutdated:abc"))
     rep.execute_task(FakeTask("outdated:yyy"))
     rep.complete_run()
     assert output.getvalue() == '["xxx", "yyy"]'
Пример #4
0
 def test_runtime_error(self):
     output = StringIO()
     rep = OutdatedReporter(output, None)
     pytest.raises(Exception, rep.runtime_error, 'error msg')
Пример #5
0
 def test_output(self):
     output = StringIO()
     rep = OutdatedReporter(output, None)
     rep.execute_task(FakeTask('foo'))
     rep.execute_task(FakeTask('outdated:xxx'))
     rep.execute_task(FakeTask('NOToutdated:abc'))
     rep.execute_task(FakeTask('outdated:yyy'))
     rep.complete_run()
     assert output.getvalue() == '["xxx", "yyy"]'