fixed connection closing issues in fixtures
This commit is contained in:
4
tests/fixtures/customer_fixtures.py
vendored
4
tests/fixtures/customer_fixtures.py
vendored
@@ -18,6 +18,8 @@ def test_customer(db, test_vendor):
|
||||
db.add(customer)
|
||||
db.commit()
|
||||
db.refresh(customer)
|
||||
# Expunge customer from session to prevent ResourceWarning about unclosed connections
|
||||
db.expunge(customer)
|
||||
return customer
|
||||
|
||||
|
||||
@@ -39,4 +41,6 @@ def test_customer_address(db, test_vendor, test_customer):
|
||||
db.add(address)
|
||||
db.commit()
|
||||
db.refresh(address)
|
||||
# Expunge address from session to prevent ResourceWarning about unclosed connections
|
||||
db.expunge(address)
|
||||
return address
|
||||
|
||||
Reference in New Issue
Block a user