def test_watchdog(self):
        done = []
        alive = True

        class FakeThread:
            def is_alive(self):
                return alive

        w = Watchdog(FakeThread(), lambda: done.append(True))
        w.start()
        time.sleep(0.2)
        self.assertTrue(w.is_alive())
        self.assertFalse(done)
        alive = False
        time.sleep(0.2)
        self.assertTrue(done)
        self.assertFalse(w.is_alive())
The watchdog thread exits when the thread it is watching exits, and
dataset/ETHPy150Open itamarst/crochet/crochet/tests/test_shutdown.py/ShutdownTests.test_watchdog