def test_joining(): t = StoppableThread() t.start() t.join() assert t.should_stop() == True
def test_thread_stopping(): t = StoppableThread() t.start() t.stop() assert t.should_stop() is True t.join()