

def test_session_cleanup_works(store, app, client):
    app.permanent_session_lifetime = timedelta(seconds=1)
    client.get('/store-in-session/k1/value1/')
    client.get('/make-session-permanent/')
    assert list(store.keys())
    app.kvsession.cleanup_sessions(app)
    assert list(store.keys())
    time.sleep(2)
    app.kvsession.cleanup_sessions(app)
    assert (not list(store.keys()))

dataset/ETHPy150Open mbr/flask-kvsession/tests/test_flask_kvsession.py test_session_cleanup_works/original