Skip to content

Commit

Permalink
fix: test async call fix on session closed early
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name committed Sep 4, 2024
1 parent 67ba2d1 commit 32fad78
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ async def seed_test_admin_adjustments(session):
admin_adjustment = AdminAdjustment(**admin_adjustment_data)
session.add(admin_adjustment)

await session.commit()
except Exception as e:
logger.error("Error occurred while seeding admin adjustments: %s", e)
raise
2 changes: 1 addition & 1 deletion backend/lcfs/db/seeders/test/test_organization_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ async def seed_test_organizations(session):
"SELECT setval('organization_attorney_address_organization_attorney_address_seq', (SELECT MAX(organization_attorney_address_id) FROM organization_attorney_address))"
)
)
await session.commit()

except Exception as e:
logger.error("Error occurred while seeding organizations: %s", e)
raise
1 change: 0 additions & 1 deletion backend/lcfs/db/seeders/test/test_transaction_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ async def seed_test_transactions(session):
transaction = Transaction(**transaction_data)
session.add(transaction)

await session.commit()
except Exception as e:
logger.error("Error occurred while seeding transactions: %s", e)
raise
2 changes: 0 additions & 2 deletions backend/lcfs/db/seeders/test/test_transfer_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,5 @@ async def seed_test_transfers(session):
logger.error(f"Error occurred while seeding transfers: {e}")
raise

await session.commit()

# Refresh the materialized view to include the new/updated transfers
await session.execute(text("REFRESH MATERIALIZED VIEW CONCURRENTLY mv_transaction_aggregate"))
1 change: 0 additions & 1 deletion backend/lcfs/db/seeders/test/test_user_profile_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ async def seed_test_user_profiles(session):
user_profile = UserProfile(**user_data)
session.add(user_profile)

await session.commit()
except Exception as e:
logger.error("Error occurred while seeding user profiles: %s", e)
raise
1 change: 0 additions & 1 deletion backend/lcfs/db/seeders/test/test_user_role_seeder.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ async def seed_test_user_roles(session):
user_role = UserRole(**user_role_data)
session.add(user_role)

await session.commit()
except Exception as e:
logger.error("Error occurred while seeding user roles: %s", e)
raise

0 comments on commit 32fad78

Please sign in to comment.