def test_early_terminated_consumers(self):
        """Consumers are terminated early, and what producer produces are not consumed."""

        def producer(q):
            time.sleep(1)
            for i in range(4096):
                q.put(1)

        def consumer(q):
            raise RuntimeError("some error")

        q = TaskQueue(producer, [consumer])

        self.assertRaises(RuntimeError, q.run)
Consumers are terminated early, and what producer produces are not consumed.
unittests/test_task_queue.py