def test_thread_started(): t = multiscanner._Thread(target=dummy, args=(2, 3)) assert not t.started t.start() time.sleep(.001) assert t.started t.join()
def test_thread_times(): t = multiscanner._Thread(target=time.sleep, args=(.1,)) t.start() t.join() assert t.starttime < t.endtime assert (t.starttime - t.endtime) < 1
def test_thread_return(): t = multiscanner._Thread(target=dummy, args=(2, 3)) t.start() t.join() assert t.ret == 6
def test_thread_times(): t = multiscanner._Thread(target=time.sleep, args=(.1, )) t.start() t.join() assert t.starttime < t.endtime assert (t.starttime - t.endtime) < 1