Reworking test_session.py