def test_no_save_invalid_session(self, pyramid_request): session_factory = SessionFactory("mysecret", "redis://redis://localhost:6379/0") session_factory.redis = pretend.stub() pyramid_request.session = InvalidSession() response = pretend.stub() session_factory._process_response(pyramid_request, response)
def test_propery_raises(self, name): session = InvalidSession() with pytest.raises(RuntimeError): getattr(session, name)
def test_methods_raise(self, method): session = InvalidSession() with pytest.raises(RuntimeError): getattr(session, method)()