def test_delete_old_sessions(suite, config_override): result = suite.run() assert result.session.id == get_last_resumeable_session_id() config_override('resume.state_retention_days', 0) result = suite.run() with pytest.raises(CannotResume): get_last_resumeable_session_id()
def test_delete_old_sessions(suite): result = suite.run() assert result.session.id == get_last_resumeable_session_id() slash.resuming._MAX_DAYS_SAVED_SESSIONS = 0 # pylint: disable=protected-access result = suite.run() with pytest.raises(CannotResume): get_last_resumeable_session_id()
def test_different_folder_no_resume_session_id(suite, tmpdir): # pylint: disable=unused-argument fail_index = len(suite) // 2 suite[fail_index].when_run.fail() suite.run() sessoin_id = get_last_resumeable_session_id() assert sessoin_id with tmpdir.ensure_dir().as_cwd(): with pytest.raises(CannotResume): sessoin_id = get_last_resumeable_session_id()
def test_get_last_resumeable_session(suite): suite[len(suite) // 2].when_run.fail() prev_id = None for i in range(5): # pylint: disable=unused-variable results = suite.run() assert results.session.id != prev_id prev_id = results.session.id assert get_last_resumeable_session_id() == results.session.id
def test_get_last_resumeable_session(suite): suite[len(suite) // 2].when_run.fail() prev_id = None for i in range(5): results = suite.run() assert results.session.id != prev_id prev_id = results.session.id save_resume_state(results.session.results) assert get_last_resumeable_session_id() == results.session.id
def test_get_last_resumeable_session(suite): suite[len(suite) // 2].when_run.fail() prev_id = None for i in range(5): results = suite.run() assert results.session.id != prev_id prev_id = results.session.id save_resume_state(results.session.results) assert get_last_resumeable_session_id() == results.session.id
def test_get_last_resumeable_session(populated_suite): populated_suite.fail_in_middle() prev_id = None for i in range(5): results = populated_suite.run() assert results.session.id != prev_id prev_id = results.session.id save_resume_state(results.session.results) assert get_last_resumeable_session_id() == results.session.id