def test_direct_done_setting(): st = StatusBase() state, cb = _setup_state_and_cb() with pytest.raises(RuntimeError): st.done = True # changing isn't allowed with pytest.warns(UserWarning): st.done = False # but for now no-ops warn st._finished() with pytest.raises(RuntimeError): st.done = False # changing isn't allowed with pytest.warns(UserWarning): st.done = True # but for now no-ops warn
def test_direct_done_setting(): st = StatusBase() state, cb = _setup_state_and_cb() with pytest.raises(RuntimeError): st.done = True # changing isn't allowed with pytest.warns(UserWarning): st.done = False # but for now no-ops warn st.set_finished() st.wait(1) time.sleep(0.1) # Wait for callbacks to run. with pytest.raises(RuntimeError): st.done = False # changing isn't allowed with pytest.warns(UserWarning): st.done = True # but for now no-ops warn