diff --git a/test/test_build.py b/test/test_build.py index 3821be8a..77d054f8 100644 --- a/test/test_build.py +++ b/test/test_build.py @@ -117,7 +117,20 @@ def test_load_requires(self): text = 'test' output = gokart.build(_LoadRequires(task=_DummyTask(param=text)), reset_register=False) self.assertEqual(output, text) - + + def test_build_with_child_task_error(self): + class CheckException(Exception): + pass + class FailTask(gokart.TaskOnKart): + def run(self): + raise CheckException() + + try: + t = FailTask() + gokart.build(t, reset_register=False, log_level=logging.CRITICAL) + except GokartBuildError as e: + self.assertEqual(len(e.raised_exceptions), 1) + self.assertIsInstance(e.raised_exceptions[t.make_unique_id()][0], CheckException) class LoggerConfigTest(unittest.TestCase): def test_logger_config(self):