def test_base_subprocesswidget_start(): sw = SubprocessWidget(cmd="echo Test", subscribe_cmd="sleep 0.5") assert sw.content is None t = threading.Thread(target=sw.start) t.start() # Lets a little overtime to be sure it's finished time.sleep(0.7) sw.stop() assert sw.content == "Test"