def test_thread_group_waits_threads_if_spawning_exception(self):
        lst = []

        with testtools.ExpectedException(RuntimeError):
            with context.ThreadGroup() as tg:
                for i in six.moves.range(400):
                    tg.spawn('add %i' % i, self._add_element, lst, i)

                raise RuntimeError()

        self.assertEqual(400, len(lst))
dataset/ETHPy150Open openstack/sahara/sahara/tests/unit/test_context.py/ContextTest.test_thread_group_waits_threads_if_spawning_exception/original