def test_it_raises_on_any_other_SQLAlchemy_exception(self, factories): fake_session = mock.Mock() fake_session.flush.side_effect = SQLAlchemyError("foo") update_svc = GroupUpdateService(session=fake_session) group = factories.Group(authority_provided_id="foo", authority="foo.com") with pytest.raises(SQLAlchemyError): update_svc.update(group, name="fingers")
def svc(db_session): return GroupUpdateService(session=db_session)